Skip to content
Snippets Groups Projects
Commit 0fbd5ea3 authored by carlosuc3m's avatar carlosuc3m
Browse files

allow different softwares to set the corresponding engines dir

parent 067c0428
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ package org.bioimageanalysis.icy.deeplearning.versionmanager.downloading; ...@@ -2,6 +2,7 @@ package org.bioimageanalysis.icy.deeplearning.versionmanager.downloading;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
...@@ -38,7 +39,7 @@ public class DeepLearningVersionDownloader ...@@ -38,7 +39,7 @@ public class DeepLearningVersionDownloader
/** /**
* The path where Deep Learning libraries are downloaded. * The path where Deep Learning libraries are downloaded.
*/ */
private static Path downloadsPath = Paths.get(".", "engines").toAbsolutePath(); private static Path downloadsPath = Paths.get("engines").toAbsolutePath();
/** /**
* Checks if the target Downloaded version is already downloaded locally. * Checks if the target Downloaded version is already downloaded locally.
...@@ -303,5 +304,12 @@ public class DeepLearningVersionDownloader ...@@ -303,5 +304,12 @@ public class DeepLearningVersionDownloader
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return pathList; return pathList;
} }
public static void setEnginesDirectory(String dir) throws IOException {
if (!(new File(dir).isDirectory()))
throw new IOException("The engines directory must correspond to an already existing folder. "
+ "The provided path is not valid: " + dir);
downloadsPath = Paths.get(dir);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment