You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2011/11/23 16:20:07 UTC
svn commit: r1205433 - in /camel/branches/camel-2.8.x: ./
camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
Author: davsclaus
Date: Wed Nov 23 15:20:06 2011
New Revision: 1205433
URL: http://svn.apache.org/viewvc?rev=1205433&view=rev
Log:
CAMEL-4705: File component should fail if auto create was enabled, and Camel could not auto create missing starting directory.
Modified:
camel/branches/camel-2.8.x/ (props changed)
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 23 15:20:06 2011
@@ -1 +1 @@
-/camel/trunk:1202148,1202167,1202204-1202206,1202215,1202223,1202659,1202685,1203879,1203978,1204338,1205124,1205372
+/camel/trunk:1202148,1202167,1202204-1202206,1202215,1202223,1202659,1202685,1203879,1203978,1204338,1205124,1205372,1205429
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java?rev=1205433&r1=1205432&r2=1205433&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java (original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java Wed Nov 23 15:20:06 2011
@@ -57,7 +57,10 @@ public class FileEndpoint extends Generi
if (isAutoCreate()) {
log.debug("Creating non existing starting directory: {}", file);
boolean absolute = FileUtil.isAbsolute(file);
- operations.buildDirectory(file.getPath(), absolute);
+ boolean created = operations.buildDirectory(file.getPath(), absolute);
+ if (!created) {
+ throw new FileNotFoundException("Cannot auto create starting directory: " + file);
+ }
} else if (isStartingDirectoryMustExist()) {
throw new FileNotFoundException("Starting directory does not exist: " + file);
}