Skip to content

Commit

Permalink
ehance the l10n (#2677)
Browse files Browse the repository at this point in the history
  • Loading branch information
tigershi authored Sep 18, 2023
1 parent b924535 commit 4c2f549
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c2f549

Please sign in to comment.