\r
**/\r
public static void main(String[] args) throws Exception {\r
- FileOperation.newFolder("C:\\aaa\\bbb\\ccc\\ddd\\eee");\r
+ FileOperation.newFolder("C:\\aaa\\aaa\\aaa\\aaa\\aaa");\r
}\r
\r
/**\r
if (folderPath.indexOf(DataType.FILE_SEPARATOR) > -1) {\r
temp = temp + folderPath.substring(0, folderPath.indexOf(DataType.FILE_SEPARATOR));\r
if (temp.endsWith(":")) {\r
- temp = temp + DataType.FILE_SEPARATOR;\r
+ temp = Tools.addFileSeparator(temp);\r
folderPath = folderPath.substring(folderPath.indexOf(DataType.FILE_SEPARATOR) + DataType.FILE_SEPARATOR.length());\r
continue;\r
}\r
- temp = temp + DataType.FILE_SEPARATOR;\r
+ temp = Tools.addFileSeparator(temp);\r
folderPath = folderPath.substring(folderPath.indexOf(DataType.FILE_SEPARATOR) + DataType.FILE_SEPARATOR.length()); \r
} else {\r
- temp = temp + DataType.FILE_SEPARATOR + folderPath;\r
+ temp = Tools.addFileSeparator(temp) + folderPath;\r
folderPath = "";\r
}\r
File f = new File(temp);\r
\r
**/\r
public static void copyFile(String oldPath, String newPath) throws Exception {\r
+ oldPath = Tools.convertPathToCurrentOsType(oldPath);\r
+ newPath = Tools.convertPathToCurrentOsType(newPath);\r
+ \r
int byteCount = 0;\r
File oldFile = new File(oldPath);\r
+ \r
+ File newFile = new File(Tools.getFilePathOnly(newPath));\r
+ if (!newFile.exists()) {\r
+ newFolder(Tools.getFilePathOnly(newPath));\r
+ }\r
\r
if (oldFile.exists()) {\r
InputStream is = new FileInputStream(oldPath);\r