You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by th...@apache.org on 2006/10/03 08:45:07 UTC
svn commit: r452322 -
/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartOnFile.java
Author: thilina
Date: Mon Oct 2 23:45:06 2006
New Revision: 452322
URL: http://svn.apache.org/viewvc?view=rev&rev=452322
Log:
Currently File caching fails if the file cache directory does not exist...
Fixing it...
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartOnFile.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartOnFile.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartOnFile.java?view=diff&rev=452322&r1=452321&r2=452322
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartOnFile.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartOnFile.java Mon Oct 2 23:45:06 2006
@@ -54,8 +54,20 @@
repoDir = ".";
}
try {
+ File repoDirFile = null;
+ if (repoDir!=null)
+ {
+ repoDirFile= new File(repoDir);
+ if (!repoDirFile.exists())
+ {
+ repoDirFile.mkdirs();
+ }
+ }
+ if (!repoDirFile.isDirectory()){
+ throw new IllegalArgumentException("Given Axis2 Attachment File Cache Location "+repoDir+" should be a directory.");
+ }
cacheFile = File.createTempFile("Axis2", ".att",
- (repoDir == null) ? null : new File(repoDir));
+ repoDirFile);
FileOutputStream fileOutStream = new FileOutputStream(cacheFile);
int value;
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org