Skip to content
Snippets Groups Projects
Commit 7764a8cd authored by cramakri's avatar cramakri
Browse files

MINOR: Fix typo.

SVN: 19989
parent 405a3c25
No related branches found
No related tags found
No related merge requests found
...@@ -47,13 +47,13 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SimpleDataSetInformationDTO; ...@@ -47,13 +47,13 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SimpleDataSetInformationDTO;
/** /**
* Utility methods for segmented stores. * Utility methods for segmented stores.
* *
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public class SegmentedStoreUtils public class SegmentedStoreUtils
{ {
private static final String RSYNC_EXEC = "rsync"; private static final String RSYNC_EXEC = "rsync";
private static final Pattern SHARE_ID_PATTERN = Pattern.compile("[0-9]+"); private static final Pattern SHARE_ID_PATTERN = Pattern.compile("[0-9]+");
private static final FileFilter FILTER_ON_SHARES = new FileFilter() private static final FileFilter FILTER_ON_SHARES = new FileFilter()
...@@ -112,12 +112,12 @@ public class SegmentedStoreUtils ...@@ -112,12 +112,12 @@ public class SegmentedStoreUtils
{ {
throw new ConfigurationFailureException( throw new ConfigurationFailureException(
"Couldn't create a test file in the following incoming folder: " "Couldn't create a test file in the following incoming folder: "
+ incomingDataDirectory, ex); + incomingDataDirectory, ex);
} }
File matchingShare = findShare(testFile, shares); File matchingShare = findShare(testFile, shares);
return matchingShare.getName(); return matchingShare.getName();
} }
private static File findShare(File testFile, File[] shares) private static File findShare(File testFile, File[] shares)
{ {
for (File share : shares) for (File share : shares)
...@@ -131,7 +131,7 @@ public class SegmentedStoreUtils ...@@ -131,7 +131,7 @@ public class SegmentedStoreUtils
} }
testFile.delete(); testFile.delete();
throw new ConfigurationFailureException( throw new ConfigurationFailureException(
"Now share could be found for the following incoming folder: " "No share could be found for the following incoming folder: "
+ testFile.getParentFile().getAbsolutePath()); + testFile.getParentFile().getAbsolutePath());
} }
...@@ -202,11 +202,11 @@ public class SegmentedStoreUtils ...@@ -202,11 +202,11 @@ public class SegmentedStoreUtils
}); });
return list; return list;
} }
/** /**
* Moves the specified data set to the specified share. The data set is folder in the store * Moves the specified data set to the specified share. The data set is folder in the store its
* its name is the data set code. The destination folder is <code>share</code>. Its name is * name is the data set code. The destination folder is <code>share</code>. Its name is the
* the share id. * share id.
* *
* @param service to access openBIS AS. * @param service to access openBIS AS.
*/ */
...@@ -236,7 +236,7 @@ public class SegmentedStoreUtils ...@@ -236,7 +236,7 @@ public class SegmentedStoreUtils
RsyncCopier copier = new RsyncCopier(OSUtilities.findExecutable(RSYNC_EXEC)); RsyncCopier copier = new RsyncCopier(OSUtilities.findExecutable(RSYNC_EXEC));
copier.copyContent(file, share); copier.copyContent(file, share);
} }
private static long assertEqualSizeAndChildren(File source, File destination) private static long assertEqualSizeAndChildren(File source, File destination)
{ {
assertSameName(source, destination); assertSameName(source, destination);
...@@ -259,15 +259,15 @@ public class SegmentedStoreUtils ...@@ -259,15 +259,15 @@ public class SegmentedStoreUtils
} }
} }
private static void assertSameNumberOfChildren(File source, File[] sourceFiles, File destination, private static void assertSameNumberOfChildren(File source, File[] sourceFiles,
File[] destinationFiles) File destination, File[] destinationFiles)
{ {
if (sourceFiles.length != destinationFiles.length) if (sourceFiles.length != destinationFiles.length)
{ {
throw new EnvironmentFailureException("Destination directory '" throw new EnvironmentFailureException("Destination directory '"
+ destination.getAbsolutePath() + "' has " + destinationFiles.length + destination.getAbsolutePath() + "' has " + destinationFiles.length
+ " files but source directory '" + source.getAbsolutePath() + " files but source directory '" + source.getAbsolutePath() + "' has "
+ "' has " + sourceFiles.length + " files."); + sourceFiles.length + " files.");
} }
} }
...@@ -277,9 +277,9 @@ public class SegmentedStoreUtils ...@@ -277,9 +277,9 @@ public class SegmentedStoreUtils
long destinationSize = destination.length(); long destinationSize = destination.length();
if (sourceSize != destinationSize) if (sourceSize != destinationSize)
{ {
throw new EnvironmentFailureException("Destination file '" + destination.getAbsolutePath() throw new EnvironmentFailureException("Destination file '"
+ "' has size " + destinationSize + " but source file '" + destination.getAbsolutePath() + "' has size " + destinationSize
+ source.getAbsolutePath() + "' has size " + sourceSize + " but source file '" + source.getAbsolutePath() + "' has size " + sourceSize
+ "."); + ".");
} }
return sourceSize; return sourceSize;
...@@ -294,7 +294,7 @@ public class SegmentedStoreUtils ...@@ -294,7 +294,7 @@ public class SegmentedStoreUtils
+ source.getAbsolutePath() + "."); + source.getAbsolutePath() + ".");
} }
} }
private static void assertFile(File file) private static void assertFile(File file)
{ {
if (file.exists() == false) if (file.exists() == false)
...@@ -311,19 +311,20 @@ public class SegmentedStoreUtils ...@@ -311,19 +311,20 @@ public class SegmentedStoreUtils
{ {
if (file.exists() == false) if (file.exists() == false)
{ {
throw new EnvironmentFailureException("Directory does not exist: " + file.getAbsolutePath()); throw new EnvironmentFailureException("Directory does not exist: "
+ file.getAbsolutePath());
} }
if (file.isDirectory() == false) if (file.isDirectory() == false)
{ {
throw new EnvironmentFailureException("Directory is a file: " + file.getAbsolutePath()); throw new EnvironmentFailureException("Directory is a file: " + file.getAbsolutePath());
} }
} }
private static File[] getFiles(File file) private static File[] getFiles(File file)
{ {
File[] files = file.listFiles(); File[] files = file.listFiles();
Arrays.sort(files); Arrays.sort(files);
return files; return files;
} }
} }
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