diff --git a/g11n-ws/vip-manager-l10n/src/main/java/com/vmware/l10n/source/service/impl/SyncLocalBundleServiceImpl.java b/g11n-ws/vip-manager-l10n/src/main/java/com/vmware/l10n/source/service/impl/SyncLocalBundleServiceImpl.java index 0561d4422..ab443e5a7 100644 --- a/g11n-ws/vip-manager-l10n/src/main/java/com/vmware/l10n/source/service/impl/SyncLocalBundleServiceImpl.java +++ b/g11n-ws/vip-manager-l10n/src/main/java/com/vmware/l10n/source/service/impl/SyncLocalBundleServiceImpl.java @@ -107,6 +107,12 @@ public synchronized void mergeSourceToLocalBundle() { } catch (L10nAPIException e) { LOGGER.error(e.getMessage(), e); moveFileFlag = false; + try { + Thread.sleep(30000); + } catch (InterruptedException ex) { + LOGGER.error(ex.getMessage(), ex); + } + DiskQueueUtils.copyFile2ExceptPath(basePath, quefile, this.activeDaoType); break; } catch (Exception e) { LOGGER.error(e.getMessage(), e); diff --git a/g11n-ws/vip-manager-l10n/src/main/java/com/vmware/l10n/utils/DiskQueueUtils.java b/g11n-ws/vip-manager-l10n/src/main/java/com/vmware/l10n/utils/DiskQueueUtils.java index ce2892a38..0ff3c90da 100644 --- a/g11n-ws/vip-manager-l10n/src/main/java/com/vmware/l10n/utils/DiskQueueUtils.java +++ b/g11n-ws/vip-manager-l10n/src/main/java/com/vmware/l10n/utils/DiskQueueUtils.java @@ -179,7 +179,24 @@ public static void moveFile2ExceptPath(String basePath, File source, String pref logger.error("move file to Exception path error:", e); } } - + /** + * copy the source cached file to L10N_TMP_EXCEP_PATH Directory and add the prefix in target file name + * @param basePath + * @param source + * @param prefix + */ + public static void copyFile2ExceptPath(String basePath, File source, String prefix){ + String targetFileName = basePath+L10N_TMP_EXCEP_PATH+source.getName().replace(SourceStr, SourceStr+prefix+ConstantsChar.UNDERLINE); + File target = new File(targetFileName); + try { + if(!target.getParentFile().exists()) { + target.getParentFile().mkdirs(); + } + Files.copy(source.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING); + } catch (IOException e) { + logger.error("move file to Exception path error:", e); + } + } /** * List the all files in Directory of L10N_TMP_EXCEP_PATH * @param basePath