Extended Temp File API

This commit is contained in:
Konloch 2024-10-02 12:07:09 -06:00
parent 5ab1fe04b5
commit 96495c8469

AI 샘플 코드 생성 중입니다

Loading...

View File

@ -44,6 +44,11 @@ public class TempFile
this.parent = parent;
}
public void markAsCreatedFile(File file)
{
createdFilePaths.add(file.getAbsolutePath());
}
public void delete()
{
//delete all the items
@ -52,6 +57,11 @@ public class TempFile
File toDelete = new File(path);
toDelete.delete();
if(!toDelete.getParentFile().getAbsolutePath().equalsIgnoreCase(new File(TEMP_DIRECTORY).getAbsolutePath()))
{
toDelete.getParentFile().delete();
}
}
//delete parent if it's not the main temp directory