Try this

    private static void main(String[] args) {

        try {

            StandardFileSystemManager manager = new
StandardFileSystemManager();
            manager.setFilesCache(new SoftRefFilesCache());
            manager.init();

            FileObject fileFtp = manager
 
.resolveFile("ftp://myAccount:[EMAIL PROTECTED]/test.html");
            fileFtp.createFile();

        } catch (Throwable t) {

            System.out.println("It doesn't work !! : " + t);
            t.printStackTrace();
        }

I catch this stack trace : 
org.apache.commons.vfs.FileSystemException: Unknown message with code
"vfs.provider/create-file.error".
        at
org.apache.commons.vfs.provider.AbstractFileObject.createFile(AbstractFileOb
ject.java:773)
        at test.FileTest.test7(FileTest.java:181)
        at test.FileTest.main(FileTest.java:38)
Caused by: org.apache.commons.vfs.FileSystemException: Could not create
folder "ftp://myAccount:[EMAIL PROTECTED]/" because it already
exists and is a file.
        at
org.apache.commons.vfs.provider.AbstractFileObject.createFolder(AbstractFile
Object.java:793)
        at
org.apache.commons.vfs.provider.AbstractFileObject.getOutputStream(AbstractF
ileObject.java:1120)
        at
org.apache.commons.vfs.provider.AbstractFileObject.getOutputStream(AbstractF
ileObject.java:1088)
        at
org.apache.commons.vfs.provider.AbstractFileObject.createFile(AbstractFileOb
ject.java:764)
        ... 2 more

-----Message d'origine-----
De : Mario Ivankovits [mailto:[EMAIL PROTECTED] 
Envoyé : vendredi 25 février 2005 10:45
À : Jakarta Commons Developers List
Objet : Re: [VFS] Asking for a solution with Zip files


Stéphane Rault wrote:

>Maybe one of your previous tests already created that folder??
>
>--> I want to create a new file at the root of my ftpserver. Surely the
>folder exist ! But the ftp provider seems to try to create it again. I 
>don't understadn why.
>  
>
Do you have some code-sniplet you could provide to see what you do.

Maybe a conditional createFolder like:

if (!fo.exists())
{
    fo.createFolder();
}

solve your problem !?

---
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to