Skip to content
Snippets Groups Projects
Commit 739cca10 authored by carlosuc3m's avatar carlosuc3m
Browse files

adapt to changes in versions download

parent 0fbd5ea3
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ import java.util.stream.IntStream;
import org.bioimageanalysis.icy.deeplearning.util.StreamUtils;
import org.bioimageanalysis.icy.deeplearning.versionmanagement.DeepLearningVersion;
import org.bioimageanalysis.icy.deeplearning.versionmanagement.InstalledDeepLearningVersions;
import com.google.common.util.concurrent.AtomicDouble;
......@@ -39,7 +40,7 @@ public class DeepLearningVersionDownloader
/**
* The path where Deep Learning libraries are downloaded.
*/
private static Path downloadsPath = Paths.get("engines").toAbsolutePath();
private static Path downloadsPath = Paths.get(InstalledDeepLearningVersions.getInstalledVersionsDir()).toAbsolutePath();
/**
* Checks if the target Downloaded version is already downloaded locally.
......@@ -92,10 +93,18 @@ public class DeepLearningVersionDownloader
* Get the path where all the Deep Learning engines are stored
* @return the path where all the Deep Learning engines are stored
*/
public static String getEnginesFolderPath() {
public static String getEnginesFolderPathAsString() {
return downloadsPath.toString();
}
/**
* Get the path where all the Deep Learning engines are stored
* @return the path where all the Deep Learning engines are stored
*/
public static Path getEnginesFolderPathAsPath() {
return downloadsPath;
}
/**
* Get String array of engine folders in the engines folder
* @return string array with folder names inside the engines folder
......@@ -304,12 +313,5 @@ public class DeepLearningVersionDownloader
}).collect(Collectors.toList());
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);
}
}
......@@ -38,6 +38,7 @@ public class DeepLearningDownloader extends Plugin implements PluginLibrary
throws IOException
{
Objects.requireNonNull(targetVersion, "Null Deep Learning version");
targetVersion.setEnginesDir();
try
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment