Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added resources/detail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/bookmark/constant/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ public class Constant {
public static final int PARENT = 1;
public static final int CHILD = 0;

public static final String ID = "bookmark.views.BookmarkView";
public static final String DATA_STORE_KEY = "bookmark_datasource";

}
41 changes: 41 additions & 0 deletions src/bookmark/utils/PathController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package bookmark.utils;

import java.io.File;

public class PathController {

public static String conversion(String path) {
String ret = path;
String separatore = File.separator;
String sepAlfa = "/";
String sepBeta = "\\";
if (path.lastIndexOf(sepAlfa) != -1 || path.lastIndexOf(sepBeta) != -1) {
if (path.lastIndexOf(separatore) == -1) {
// devo switchare
if (separatore.equals(sepAlfa)) {
ret = path.replace(sepBeta, sepAlfa);
} else if (separatore.equals(sepBeta)) {
ret = path.replace(sepAlfa, sepBeta);
}
}
}
return ret;
}

public static boolean check(String path) {
boolean ret = false;
String sepCheck = "";
String sepAlfa = "/";
String sepBeta = "\\";
if (!File.separator.equals(sepAlfa)) {
sepCheck = sepAlfa;
} else if (!File.separator.equals(sepBeta)) {
sepCheck = sepBeta;
}
if (!sepCheck.equals("") && path.lastIndexOf(sepCheck) != -1) {
ret = true;
}
return ret;
}

}
Loading