CropAssetCopyTool

This commit is contained in:
gexce
2017-08-17 16:30:12 +02:00
parent 21fa417bc8
commit fbd663142f
@@ -39,7 +39,7 @@ public class CropAssetCopyTool {
private static String assetPath = "D:\\Toolbox\\Assets"; private static String assetPath = "D:\\Toolbox\\Assets";
private static String videoPath = "D:\\Toolbox\\Movies\\"; private static String videoPath = "D:\\Toolbox\\Movies\\";
private static File targetDir = new File("D:\\UploadAssets\\"); private static File targetDir = new File("D:\\UploadAssets");
private static String videoTargetPath = "D:\\UploadVideos"; private static String videoTargetPath = "D:\\UploadVideos";
private static File videoTargetDir = new File(videoTargetPath); private static File videoTargetDir = new File(videoTargetPath);
@@ -150,7 +150,7 @@ public class CropAssetCopyTool {
} }
} }
else { else {
File targetFile = new File(targetDir + targetName); File targetFile = new File(targetDir + "\\" + targetName);
if (targetFile.exists()) { if (targetFile.exists()) {
while (targetFile.exists()) { while (targetFile.exists()) {
@@ -164,14 +164,14 @@ public class CropAssetCopyTool {
newName = oldName.substring(0, oldName.length() - 3) + String.format("%03d", num) + "." newName = oldName.substring(0, oldName.length() - 3) + String.format("%03d", num) + "."
+ FilenameUtils.getExtension(oldName); + FilenameUtils.getExtension(oldName);
} }
targetFile = new File(targetDir + newName); targetFile = new File(targetDir + "\\" + newName);
} }
log.info("(AssetID " + assetId + ") Target file '" + targetName + "' already exists. Copy file as '" + targetFile.getName() + "'"); log.info("(AssetID " + assetId + ") Target file '" + targetName + "' already exists. Copy file as '" + targetFile.getName() + "'");
line[1] = targetFile.getName(); line[1] = targetFile.getName();
} }
log.debug("(AssetID " + assetId + ") Copy " + file.getName() + " to " + targetFile.getAbsolutePath()); log.debug("Copy " + file.getAbsolutePath() + " (AssetID " + assetId + ") to " + targetFile.getAbsolutePath());
if (!dryRun) if (!dryRun)
FileUtils.copyFile(file, targetFile); FileUtils.copyFile(file, targetFile);