}\r
}\r
}\r
- \r
+\r
/**\r
Get path only from a path\r
- \r
+ \r
@param filePath\r
@return\r
- \r
- **/\r
+ \r
+ **/\r
public static String getFilePathOnly(String filePath) {\r
String path = filePath.substring(0, filePath.length() - getFileNameOnly(filePath).length());\r
if (path.endsWith(DataType.FILE_SEPARATOR)) {\r
path = path.substring(0, path.length() - DataType.FILE_SEPARATOR.length());\r
}\r
- \r
+\r
return path;\r
}\r
- \r
- \r
+\r
/**\r
Get file name from a path\r
\r
@param filePath\r
@return\r
- \r
- **/\r
+ \r
+ **/\r
public static String getFileNameOnly(String filePath) {\r
File f = new File(filePath);\r
return f.getAbsoluteFile().getName();\r
}\r
- \r
+\r
public static String getFileNameWithoutExt(String filePath) {\r
filePath = getFileNameOnly(filePath);\r
filePath = filePath.substring(0, filePath.lastIndexOf(DataType.FILE_EXT_SEPARATOR));\r
}\r
return path;\r
}\r
- \r
+\r
/**\r
Show a message box\r
\r
@param arg0\r
- \r
- **/\r
+ \r
+ **/\r
public static void showInformationMessage(String arg0) {\r
JOptionPane.showConfirmDialog(null, arg0, "Error", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);\r
}\r
+ \r
+ /**\r
+ if the string doesn't end with a file separator, append it to the string\r
+ \r
+ @param arg0\r
+ @return\r
+ \r
+ **/\r
+ public static String addFileSeparator(String arg0) {\r
+ if (!arg0.endsWith(DataType.FILE_SEPARATOR)) {\r
+ arg0 = arg0 + DataType.FILE_SEPARATOR;\r
+ }\r
+ return arg0;\r
+ }\r
}\r