File tree 1 file changed +10
-5
lines changed
app/src/processing/app/helpers 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 5
5
import java .io .FileOutputStream ;
6
6
import java .io .IOException ;
7
7
import java .util .Random ;
8
+ import java .util .regex .Pattern ;
8
9
9
10
public class FileUtils {
10
11
12
+ private static final Pattern BACKSLASH = Pattern .compile ("\\ \\ " );
13
+
11
14
/**
12
15
* Checks, whether the child directory is a subdirectory of the base directory.
13
- *
14
- * @param base
15
- * the base directory.
16
- * @param child
17
- * the suspected child directory.
16
+ *
17
+ * @param base the base directory.
18
+ * @param child the suspected child directory.
18
19
* @return true, if the child is a subdirectory of the base directory.
19
20
*/
20
21
public static boolean isSubDirectory (File base , File child ) {
@@ -158,4 +159,8 @@ public static String relativePath(String origin, String target) {
158
159
159
160
return relative + target .substring (origin .length () + 1 );
160
161
}
162
+
163
+ public static String getLinuxPathFrom (File file ) {
164
+ return BACKSLASH .matcher (file .getAbsolutePath ()).replaceAll ("/" );
165
+ }
161
166
}
You can’t perform that action at this time.
0 commit comments