Perhaps, you can have various configurations that you can pick depending on the 
OS version the app is running?

System.getProperty("os.name") should give you OS name002E



-----Original Message-----
From: AK [mailto:[email protected]]
Sent: Tuesday, March 31, 2009 6:57 PM
To: [email protected]
Subject: Re: [Stripes-users] Can't save file to disk

AK <ama-l...@...> writes:

>
> I have the following code in a try block and am running up against the
> following exception:
>
> java.io.FileNotFoundException: \dev\javalib\Stripes\projects\myApp\web
> \imageUploads\75.jpg (The system cannot find the path specified)
>
> Here's the code:
>
...
> String imgDir = prop.getProperty("myApp.location.imageUploads");
> logger.debug("*** dir from property: " + imgDir);
>

OK.  So much for write once, run anywhere.  If I change my imgPath to be on the
C-drive, the file saves!

String imgPath = "c:/" + imgDir + File.separator + newImageName;

How is this supposed to be portable code (developing on Win and deploying on
Lin) if I have to specif the app location based on the OS it's running on?  Am
I doing something wrong that's put me in this conundrum?



------------------------------------------------------------------------------
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to