mirror of https://github.com/apache/jclouds.git
Merge pull request #763 from andrewgaul/filesystem-replace
Prefer string replacement over regular expression
This commit is contained in:
commit
00f5f0367d
|
@ -349,10 +349,10 @@ public class FilesystemStorageStrategyImpl implements LocalStorageStrategy {
|
|||
* @param pathToBeNormalized
|
||||
* @return
|
||||
*/
|
||||
private String normalize(String pathToBeNormalized) {
|
||||
private static String normalize(String pathToBeNormalized) {
|
||||
if (null != pathToBeNormalized && pathToBeNormalized.contains(BACK_SLASH)) {
|
||||
if (!BACK_SLASH.equals(File.separator)) {
|
||||
return pathToBeNormalized.replaceAll(BACK_SLASH, File.separator);
|
||||
return pathToBeNormalized.replace(BACK_SLASH, File.separator);
|
||||
}
|
||||
}
|
||||
return pathToBeNormalized;
|
||||
|
|
|
@ -123,15 +123,6 @@ public class FilesystemStorageStrategyImplTest {
|
|||
storageStrategy.createDirectory(CONTAINER_NAME, null);
|
||||
}
|
||||
|
||||
@Test(dataProvider = "ignoreOnWindows", description = "see http://code.google.com/p/jclouds/issues/detail?id=737")
|
||||
public void testCreateDirectory_WrongDirectoryName() {
|
||||
try {
|
||||
storageStrategy.createDirectory(CONTAINER_NAME, "$%&!'`\\/");
|
||||
fail("No exception thrown");
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
public void testCreateContainer() {
|
||||
boolean result;
|
||||
|
||||
|
|
Loading…
Reference in New Issue