Skip to content
Snippets Groups Projects
Commit dd7fcfed authored by vkovtun's avatar vkovtun
Browse files

BIS-1043: Fixed the issue that the exported file contained the directory...

BIS-1043: Fixed the issue that the exported file contained the directory "original" instead of default. Wrote a method that fixes the naming.
parent d6e39adc
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
......@@ -1249,7 +1249,7 @@ public class ExportExecutor implements IExportExecutor
final boolean compatibleWithImport) throws IOException
{
final DataSetFile dataSetFile = dataSetFileDownload.getDataSetFile();
final String filePath = dataSetFile.getPath();
final String filePath = fixFilePath(dataSetFile);
final boolean isDirectory = dataSetFile.isDirectory();
final File dataSetFsEntry;
......@@ -1284,6 +1284,25 @@ public class ExportExecutor implements IExportExecutor
}
}
/**
* Replaces "original" with "default" directory name.
*
* @param dataSetFile the file object that contains the path information.
* @return <code>dataSetFile.getPath()</code> as is or with "original" replaced with "default".
*/
private static String fixFilePath(final DataSetFile dataSetFile)
{
final String originalPath = dataSetFile.getPath();
if (dataSetFile.isDirectory() && Objects.equals(originalPath, "original"))
{
return "default";
} else if (originalPath.startsWith("original/")) {
return "default" + originalPath.substring("original".length());
} else {
return originalPath;
}
}
static String getDataDirectoryName(final char prefix, final String spaceCode, final String projectCode,
final String containerCode, final String entityCode, final String dataSetTypeCode,
final String dataDirectorySuffix, final String fileName)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment