임시폴더생성 api 수정 #58
@@ -21,9 +21,13 @@ public class TmpDatasetService {
|
||||
public Path buildTmpDatasetSymlink(String uid, List<String> datasetUids) throws IOException {
|
||||
|
||||
// 환경에 맞게 yml로 빼는 걸 추천
|
||||
Path BASE = Paths.get(requestDir);
|
||||
Path BASE = toPath(requestDir);
|
||||
Path tmp = BASE.resolve("tmp").resolve(uid);
|
||||
|
||||
log.info("requestDir(raw)={}", requestDir);
|
||||
log.info("BASE(abs)={}", BASE.toAbsolutePath().normalize());
|
||||
log.info("BASE exists? {}", Files.isDirectory(BASE));
|
||||
|
||||
// mkdir -p "$TMP"/train/{input1,input2,label} ...
|
||||
for (String type : List.of("train", "val")) {
|
||||
for (String part : List.of("input1", "input2", "label")) {
|
||||
@@ -38,6 +42,7 @@ public class TmpDatasetService {
|
||||
for (String part : List.of("input1", "input2", "label")) {
|
||||
|
||||
Path srcDir = srcRoot.resolve(type).resolve(part);
|
||||
log.info("srcRoot={} exists={}", srcRoot, Files.isDirectory(srcRoot));
|
||||
|
||||
// zsh NULL_GLOB: 폴더가 없으면 그냥 continue
|
||||
if (!Files.isDirectory(srcDir)) continue;
|
||||
@@ -63,4 +68,11 @@ public class TmpDatasetService {
|
||||
log.info("tmp dataset created: {}", tmp);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
private static Path toPath(String p) {
|
||||
if (p.startsWith("~/")) {
|
||||
return Paths.get(System.getProperty("user.home")).resolve(p.substring(2)).normalize();
|
||||
}
|
||||
return Paths.get(p).toAbsolutePath().normalize();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user