You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Seem <si...@gmx.de> on 2008/12/17 18:45:49 UTC

How to create or write to an existing file inside .aar during runtime?

Hi,

is it possible to create or update a file inside the .aar during the service
process?
Is there an examplary workaround?

I tried it like this:

String ccFilename = Name of the File anf not a FileObject
....
try 
        {
        	FileWriter create = new FileWriter(ccFilename);
        	create.close();
        } 
catch (IOException e)
        {
        	System.err.println("<ContextStore> FATAL: file to read "
        			+"consistent context was not found and could not be created");
        }

and I always got the IOE.

-- 
View this message in context: http://www.nabble.com/How-to-create-or-write-to-an-existing-file-inside-.aar-during-runtime--tp21057898p21057898.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: How to create or write to an existing file inside .aar during runtime?

Posted by Seem <si...@gmx.de>.
Step by Step I getting to the source of my problems....

During the runtime process, I will get FileNames as Strings which are
composed with an associated relative path (like "etc/file.name"). Without
the relative path the creating is possible, but with the unknown path...
Do you know any tricks?

Other Question:

Is it possible to save a created file persistently inside an .aar? Also
after the shutdown of the server. Or do I need to save them inside a folder
of tomcat for persistence?


Thanks in advance!



Seem wrote:
> 
> I also tried with no success.
> 
>           FileOutputStream create = new FileOutputStream(ccFilename);
>           create.close();
> 
> In Eclipse everything is working fine, but not if packed as an .aar and
> deployed inside the axis-container.
> 
> 
> 
> 
> Seem wrote:
>> 
>> Hi,
>> 
>> is it possible to create or update a file inside the .aar during the
>> service process?
>> Is there an examplary workaround?
>> 
>> I tried it like this:
>> 
>> String ccFilename = Name of the File anf not a FileObject
>> ....
>> try 
>>         {
>>         	FileWriter create = new FileWriter(ccFilename);
>>         	create.close();
>>         } 
>> catch (IOException e)
>>         {
>>         	System.err.println("<ContextStore> FATAL: file to read "
>>         			+"consistent context was not found and could not be created");
>>         }
>> 
>> and I always got the IOE.
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-create-or-write-to-an-existing-file-inside-.aar-during-runtime--tp21057898p21058755.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: How to create or write to an existing file inside .aar during runtime?

Posted by Seem <si...@gmx.de>.
I also tried with no success.

          FileOutputStream create = new FileOutputStream(ccFilename);
          create.close();

In Eclipse everything is working fine, but not if packed as an .aar and
deployed inside the axis-container.




Seem wrote:
> 
> Hi,
> 
> is it possible to create or update a file inside the .aar during the
> service process?
> Is there an examplary workaround?
> 
> I tried it like this:
> 
> String ccFilename = Name of the File anf not a FileObject
> ....
> try 
>         {
>         	FileWriter create = new FileWriter(ccFilename);
>         	create.close();
>         } 
> catch (IOException e)
>         {
>         	System.err.println("<ContextStore> FATAL: file to read "
>         			+"consistent context was not found and could not be created");
>         }
> 
> and I always got the IOE.
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-create-or-write-to-an-existing-file-inside-.aar-during-runtime--tp21057898p21058316.html
Sent from the Axis - User mailing list archive at Nabble.com.