import java.io.File;
import java.io.IOException;
+import jalview.util.FileUtils;
+
import com.threerings.getdown.util.FileUtil;
/**
private void createDirectoryIfNecessary (File dir) throws IOException
{
- if (!dir.exists() && !dir.mkdirs()) {
+ if (!dir.exists() && !FileUtils.mkdirs(dir)) {
throw new IOException("unable to create directory: " + dir.getAbsolutePath());
}
}
// return false;
//}
if (!userAppDir.exists()) {
- userAppDir.mkdirs();
+ FileUtils.mkdirs(userAppDir);
}
if (!(applicationAppDir.isDirectory() && userAppDir.isDirectory())) {
log.warning("Parameter not a directory", "applicaitonAppDirName", applicationAppDirName, "userAppDirName", userAppDirName);
continue;
}
if (!to.getParentFile().exists()) {
- to.getParentFile().mkdirs();
+ FileUtils.mkdirs(to.getParentFile());
}
try {
Files.copy(from.toPath(), to.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES);
// that runs getdown with an appdir and appbase specified, and have getdown create the
// appdir and download the app into it
if (!StringUtil.isBlank(appBase)) {
- if (appDirFile.mkdirs()) {
+ if (FileUtils.mkdirs(appDirFile)) {
notes.add(Note.info("Auto-created app directory '" + appDir + "'"));
} else {
notes.add(Note.warn("Unable to auto-create app dir: '" + appDir + "'"));
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
+import jalview.util.FileUtils;
+
import com.threerings.getdown.data.Resource;
import static com.threerings.getdown.Log.log;
for (final Resource rsrc : resources) {
// make sure the resource's target directory exists
File parent = new File(rsrc.getLocal().getParent());
- if (!parent.exists() && !parent.mkdirs()) {
+ if (!parent.exists() && !FileUtils.mkdirs(parent)) {
log.warning("Failed to create target directory for resource '" + rsrc + "'.");
}
import com.threerings.getdown.util.ProgressObserver;
import com.threerings.getdown.util.StreamUtil;
+import jalview.util.FileUtils;
+
import static com.threerings.getdown.Log.log;
/**
// make sure the file's parent directory exists
File pdir = target.getParentFile();
- if (!pdir.exists() && !pdir.mkdirs()) {
+ if (!pdir.exists() && !FileUtils.mkdirs(pdir)) {
log.warning("Failed to create parent for '" + target + "'.");
}
import java.util.jar.*;
import java.util.zip.GZIPInputStream;
+import jalview.util.FileUtils;
+
import com.threerings.getdown.util.StreamUtil;
import com.threerings.getdown.Log;
import static com.threerings.getdown.Log.log;
// but some do not, so we want to ensure that our directories exist
// prior to getting down and funky
File parent = new File(efile.getParent());
- if (!parent.exists() && !parent.mkdirs()) {
+ if (!parent.exists() && !FileUtils.mkdirs(parent)) {
log.warning("Failed to create jar entry parent", "jar", jar, "parent", parent);
continue;
}
}
}
- return parentDir.mkdirs();
+ return mkdirs(parentDir);
}
/**
try
{
Files.createDirectory(getCanonicalPath(file));
- return true;
+ return file.exists();
} catch (IOException e)
{
LaunchUtils.syserr(true, false, "Failed to make directory " + file
}
}
- return parentDir.mkdirs();
+ return mkdirs(parentDir);
}
/**
try
{
Files.createDirectory(getCanonicalPath(file));
- return true;
+ return file.exists();
} catch (IOException e)
{
LaunchUtils.syserr(true, false, "Failed to make directory " + file