mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-05 02:22:55 +01:00
feat: new "copyToDir" where inFilename/outFilename differs
This commit is contained in:
parent
73ac0d96fb
commit
d068c3e481
@ -41,17 +41,19 @@ public class DirUtil {
|
|||||||
|
|
||||||
public static void copyToDir(Directory in, Directory out, String fileName)
|
public static void copyToDir(Directory in, Directory out, String fileName)
|
||||||
throws DirectoryException {
|
throws DirectoryException {
|
||||||
|
copyToDir(in, out, fileName, fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void copyToDir(Directory in, Directory out, String inFile, String outFile)
|
||||||
|
throws DirectoryException {
|
||||||
try {
|
try {
|
||||||
if (in.containsDir(fileName)) {
|
if (in.containsDir(inFile)) {
|
||||||
// TODO: remove before copying
|
in.getDir(inFile).copyToDir(out.createDir(outFile));
|
||||||
in.getDir(fileName).copyToDir(out.createDir(fileName));
|
|
||||||
} else {
|
} else {
|
||||||
BrutIO.copyAndClose(in.getFileInput(fileName),
|
BrutIO.copyAndClose(in.getFileInput(inFile), out.getFileOutput(outFile));
|
||||||
out.getFileOutput(fileName));
|
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new DirectoryException(
|
throw new DirectoryException("Error copying file: " + inFile, ex);
|
||||||
"Error copying file: " + fileName, ex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user