mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[CST-5699] fix duplicate separator on working directories
This commit is contained in:
@@ -788,7 +788,8 @@ public class ItemExportServiceImpl implements ItemExportService {
|
||||
throw new Exception(
|
||||
"A dspace.cfg entry for 'org.dspace.app.itemexport.work.dir' does not exist.");
|
||||
}
|
||||
return exportDir;
|
||||
// clean work dir path from duplicate separators
|
||||
return StringUtils.replace(exportDir, File.separator + File.separator, File.separator);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1050,8 +1051,11 @@ public class ItemExportServiceImpl implements ItemExportService {
|
||||
return;
|
||||
}
|
||||
String strAbsPath = cpFile.getPath();
|
||||
String strZipEntryName = strAbsPath.substring(strSource
|
||||
.length(), strAbsPath.length());
|
||||
int startIndex = strSource.length();
|
||||
if (!StringUtils.endsWith(strSource, File.separator)) {
|
||||
startIndex++;
|
||||
}
|
||||
String strZipEntryName = strAbsPath.substring(startIndex, strAbsPath.length());
|
||||
|
||||
// byte[] b = new byte[ (int)(cpFile.length()) ];
|
||||
|
||||
|
@@ -202,6 +202,8 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
|
||||
logError("Cannot create batch import directory! " + tempWorkDir);
|
||||
}
|
||||
}
|
||||
// clean work dir path from duplicate separators
|
||||
tempWorkDir = StringUtils.replace(tempWorkDir, File.separator + File.separator, File.separator);
|
||||
}
|
||||
|
||||
// File listing filter to look for metadata files
|
||||
|
Reference in New Issue
Block a user