Commit da056f6b authored by noname's avatar noname

dialogDeckSelect

parent f77175cc
...@@ -167,22 +167,10 @@ public class FileUtils { ...@@ -167,22 +167,10 @@ public class FileUtils {
} }
public static void copyFile(String oldPath, String newPath) throws IOException { public static void copyFile(String oldPath, String newPath) throws IOException {
copyFile(oldPath, newPath, true);
}
public static void copyFile(String oldPath, String newPath, boolean isName) throws IOException {
//判断复制后的路径是否含有文件名,如果没有则加上
if (!isName) {
//由于newPath是路径加文件名,所以获取要复制的文件名与复制后的路径组成新的newPath
String abb[] = oldPath.split("/");
newPath = newPath + "/" + abb[abb.length - 1];
}
FileInputStream fis = new FileInputStream(oldPath); FileInputStream fis = new FileInputStream(oldPath);
FileOutputStream fos = new FileOutputStream(newPath); FileOutputStream fos = new FileOutputStream(newPath);
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
int len = 0; int len;
while ((len = fis.read(buf)) != -1) { while ((len = fis.read(buf)) != -1) {
fos.write(buf, 0, len); fos.write(buf, 0, len);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment