|
|
|
@ -119,12 +119,20 @@ public class FileOperationHelper {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String copyFile(FileNode sourceFile, String targetDir, boolean withCopyVcs) { |
|
|
|
|
String sourcePath = sourceFile.getEnvPath(); |
|
|
|
|
if (!TemplateResourceManager.getResource().exist(sourcePath)) { |
|
|
|
|
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Source_File_Not_Exist", sourcePath), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Alert"), |
|
|
|
|
WARNING_MESSAGE); |
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
} |
|
|
|
|
String name = getNoRepeatedName4Paste(targetDir, sourceFile.getName()); |
|
|
|
|
String targetFile = StableUtils.pathJoin(targetDir, name); |
|
|
|
|
if (sourceFile.isDirectory()) { |
|
|
|
|
copyDir(sourceFile.getEnvPath(), targetFile, withCopyVcs); |
|
|
|
|
copyDir(sourcePath, targetFile, withCopyVcs); |
|
|
|
|
} else { |
|
|
|
|
copyFile(sourceFile.getEnvPath(), targetFile, withCopyVcs); |
|
|
|
|
copyFile(sourcePath, targetFile, withCopyVcs); |
|
|
|
|
} |
|
|
|
|
return targetFile; |
|
|
|
|
} |
|
|
|
|