DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37102>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37102

           Summary: Exception using ftp when copying to a directory with a
                    tab in its name
           Product: Commons
           Version: Nightly Builds
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: VFS
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


Hello, 

When I'm trying to copy a file from Windows XP Professional to a directory with
a tab in its name on a remote Sun Solaris Server I got an exception. It also
doesn't work if you try to copy the file from an Solaris server to another
Solaris server. The exception occurs not in the copy action itself, but when
checking the file size of the copied file on the remote server.

The exception is
org.apache.commons.vfs.FileSystemException: Could not determine the size of file
"ftp://myuser:[EMAIL PROTECTED]/tmp/DeltaBuckets -
Americas/atlasfile.20050501".

        at
org.apache.commons.vfs.provider.DefaultFileContent.getSize(DefaultFileContent.java:111)
        at de.andreas.transport.FTPTransport.main(FTPTransport.java:31)
Caused by: java.lang.NullPointerException
        at
org.apache.commons.vfs.provider.ftp.FtpFilexObject.doGetContentSize(FtpFilexObject.java:404)
        at
org.apache.commons.vfs.provider.DefaultFileContent.getSize(DefaultFileContent.java:107)
        ... 1 more


It occurs in the following java program/snippet.

package de.andreas.transport;

import java.io.*;
import org.apache.commons.vfs.*;
import org.apache.commons.vfs.provider.AbstractFileSystem;



public class FTPTransport {
                       
                        //Using commons-vfs-1.0-RC4.jar from
commons-vfs-20051011.zip

       
        public static void main(String[] args){
                        try {
                                //copy a file via ftp to a remote server
                                FilexObject quelle =
VFS.getManager().resolveFile("file://c:/daten/spice/export/ATLAS/atlasfile.20050501");

                                FilexObject ziel = null;
                                //works                        
                                //ziel =
VFS.getManager().resolveFile("ftp://myuser:[EMAIL 
PROTECTED]/tmp/DeltaBuckets-Americas/atlasfile.20050501");

                               
                                //doesn't work
                                ziel =
VFS.getManager().resolveFile("ftp://myuser:[EMAIL 
PROTECTED]/tmp/DeltaBuckets-Americas/atlasfile.20050501");

                               
                                //doesn't work
                                //ziel =
VFS.getManager().resolveFile("ftp://myuser:[EMAIL PROTECTED]/tmp/DeltaBuckets
- Americas/atlasfile.20050501");

                               
                                ziel.copyFrom(quelle,
Selectors.SELECT_ALL);//works fine                               

                                //check fileSizes
                                if (ziel.getContent().getSize() ==
quelle.getContent().getSize()){
                                        System.out.println("Good!");           
                       
                                }
                                else {
                                        System.out.println("Bad!");
                                }
                        } catch (Exception ex){
                                ex.printStackTrace();
                        }
                }
                       
                        /*
                         log4j:WARN No appenders could be found for logger
(org.apache.commons.vfs.impl.StandardFileSystemManager).

log4j:WARN Please initialize the log4j system properly.
org.apache.commons.vfs.FileSystemException: Could not determine the size of file
"ftp://myuser:[EMAIL PROTECTED]/tmp/DeltaBuckets -
Americas/atlasfile.20050501".

        at
org.apache.commons.vfs.provider.DefaultFileContent.getSize(DefaultFileContent.java:111)
        at 
de.hvb.m0.business.mds.transport.FTPTransport.main(FTPTransport.java:31)
Caused by: java.lang.NullPointerException
        at
org.apache.commons.vfs.provider.ftp.FtpFilexObject.doGetContentSize(FtpFilexObject.java:404)
        at
org.apache.commons.vfs.provider.DefaultFileContent.getSize(DefaultFileContent.java:107)
        ... 1 more


*/
                       

}

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to