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)
|
||||
throws DirectoryException {
|
||||
copyToDir(in, out, fileName, fileName);
|
||||
}
|
||||
|
||||
public static void copyToDir(Directory in, Directory out, String inFile, String outFile)
|
||||
throws DirectoryException {
|
||||
try {
|
||||
if (in.containsDir(fileName)) {
|
||||
// TODO: remove before copying
|
||||
in.getDir(fileName).copyToDir(out.createDir(fileName));
|
||||
if (in.containsDir(inFile)) {
|
||||
in.getDir(inFile).copyToDir(out.createDir(outFile));
|
||||
} else {
|
||||
BrutIO.copyAndClose(in.getFileInput(fileName),
|
||||
out.getFileOutput(fileName));
|
||||
BrutIO.copyAndClose(in.getFileInput(inFile), out.getFileOutput(outFile));
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
throw new DirectoryException(
|
||||
"Error copying file: " + fileName, ex);
|
||||
throw new DirectoryException("Error copying file: " + inFile, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user