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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to