The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:Although you specifically mentioned that you're uploading files to a folder, I'll go ahead with the standard warning that you should never upload anything to be inside your WAR or appserver directories, just in case you thought that you could create upload folders in the WAR (Well, you often can, but sooner or later, you'll regret it).
And, of course, uploading actually gets staged from a general upload facility, so that the incoming data has to be serialized out to a file that you yourself create - you shouldn't expect that data to live indefinitely in the staging area.
Once the preceding annoying details have been attended to, the actual process of renaming a file is fairly easy. Just use the java.io.File renameTo() method.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:I believe one of them is in cases where you want to move the file to a different drive letter (for that, you have to do things the hard way, via copy-and-delete).
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Tim Holloway wrote:
There a a number of reasons why renameTo() can fail. I believe one of them is in cases where you want to move the file to a different drive letter (for that, you have to do things the hard way, via copy-and-delete). So if you could provide some details on how your rename attempt is set up and what error response you get, it would be a big help.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Yes it can be done, we just have to figure out how.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |