case and application level temp; may need to be refactored to different class

This commit is contained in:
Greg DiCristofaro 2020-08-10 16:33:54 -04:00
parent 2164494d94
commit dad32dbc39

View File

@ -38,6 +38,7 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
@ -64,6 +65,7 @@ import javax.swing.SwingUtilities;
import org.openide.util.Lookup; import org.openide.util.Lookup;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.openide.util.NotImplementedException;
import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.CallableSystemAction;
import org.openide.windows.WindowManager; import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.actions.OpenOutputFolderAction; import org.sleuthkit.autopsy.actions.OpenOutputFolderAction;
@ -1345,6 +1347,34 @@ public class Case {
return hostPath.toString(); return hostPath.toString();
} }
private static String getJoinedPaths(String...pathComponents) {
if (pathComponents == null) {
return null;
}
if (pathComponents.length < 1) {
return "";
}
String[] remaining = Arrays.copyOfRange(pathComponents, 1, pathComponents.length);
return Paths.get(pathComponents[0], remaining).toAbsolutePath().toString();
}
private String getBaseTempDirectory() {
// TODO
throw new NotImplementedException();
}
private String getBaseTempDirectory() {
// TODO
throw new NotImplementedException();
}
private static final String AUTOPSY_FOLDER_NAME =
/** /**
* Gets the full path to the temp directory for this case, creating it if it * Gets the full path to the temp directory for this case, creating it if it
* does not exist. * does not exist.
@ -1352,6 +1382,7 @@ public class Case {
* @return The temp subdirectory path. * @return The temp subdirectory path.
*/ */
public String getTempDirectory() { public String getTempDirectory() {
return getOrCreateDirectory(Paths.get(getBaseTempDirectory(), ))
return getOrCreateSubdirectory(TEMP_FOLDER); return getOrCreateSubdirectory(TEMP_FOLDER);
} }