Expression alignment and related polishing (backported from master)

This commit is contained in:
Juergen Hoeller
2017-07-14 15:41:38 +02:00
parent bffcd33ea3
commit bb6d9fabee
8 changed files with 273 additions and 257 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -58,7 +58,8 @@ public abstract class FileSystemUtils {
* @throws IOException in the case of I/O errors
*/
public static void copyRecursively(File src, File dest) throws IOException {
Assert.isTrue(src != null && (src.isDirectory() || src.isFile()), "Source File must denote a directory or file");
Assert.isTrue(src != null && (src.isDirectory() || src.isFile()),
"Source File must denote a directory or file");
Assert.notNull(dest, "Destination File must not be null");
doCopyRecursively(src, dest);
}
@@ -86,9 +87,7 @@ public abstract class FileSystemUtils {
dest.createNewFile();
}
catch (IOException ex) {
IOException ioex = new IOException("Failed to create file: " + dest);
ioex.initCause(ex);
throw ioex;
throw new IOException("Failed to create file: " + dest, ex);
}
FileCopyUtils.copy(src, dest);
}