Commit ec604a6a by amateur

1

1 parent dd2891af
...@@ -4,7 +4,11 @@ import java.io.File; ...@@ -4,7 +4,11 @@ import java.io.File;
public class FileUtils { public class FileUtils {
public static File getDistPath() { public static File getIndex() {
return new File(getDistDir(), "index.html");
}
public static File getDistDir() {
File dist = new File(getRootDir(), "dist"); File dist = new File(getRootDir(), "dist");
if (!dist.exists()) { if (!dist.exists()) {
dist.mkdirs(); dist.mkdirs();
...@@ -12,7 +16,19 @@ public class FileUtils { ...@@ -12,7 +16,19 @@ public class FileUtils {
return dist; return dist;
} }
public static File getDownloadDir() {
File download = new File(getRootDir(), "download");
if (!download.exists()) {
download.mkdirs();
}
return download;
}
public static File getRootDir() { public static File getRootDir() {
return CtxUtils.getApplication().getFilesDir(); return CtxUtils.getApplication().getFilesDir();
} }
public static File getRootCacheDir() {
return CtxUtils.getApplication().getCacheDir();
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!