Search in sources :

Example 6 with IRemoteFile

use of org.eclipse.ecf.filetransfer.IRemoteFile in project ecf by eclipse.

the class URLBrowseTest method verifyRemoteFilesWithoutLastModifiedAndContentLength.

protected void verifyRemoteFilesWithoutLastModifiedAndContentLength(final IRemoteFile[] remoteFiles) {
    for (int i = 0; i < remoteFiles.length; i++) {
        final IRemoteFile first = remoteFiles[i];
        final IRemoteFileInfo firstInfo = first.getInfo();
        assertNotNull(firstInfo);
        final IFileID firstID = first.getID();
        assertNotNull(firstID);
        trace("firstID=" + firstID);
        // Now check out info
        assertNotNull(firstInfo.getName());
        // TODO: should this be -1
        assertEquals(0, firstInfo.getLastModified());
        trace("length=" + firstInfo.getLength());
        trace("isDirectory=" + firstInfo.isDirectory());
        final IRemoteFileAttributes attributes = firstInfo.getAttributes();
        assertNotNull(attributes);
        final Iterator attrNames = attributes.getAttributeKeys();
        for (; attrNames.hasNext(); ) {
            final String key = (String) attrNames.next();
            String s = "attrname=" + key;
            s += " attrvalue=" + attributes.getAttribute(key);
            trace(s);
        }
    }
}
Also used : IFileID(org.eclipse.ecf.filetransfer.identity.IFileID) IRemoteFileInfo(org.eclipse.ecf.filetransfer.IRemoteFileInfo) IRemoteFile(org.eclipse.ecf.filetransfer.IRemoteFile) Iterator(java.util.Iterator) IRemoteFileAttributes(org.eclipse.ecf.filetransfer.IRemoteFileAttributes)

Aggregations

IRemoteFile (org.eclipse.ecf.filetransfer.IRemoteFile)6 Iterator (java.util.Iterator)3 IRemoteFileSystemBrowseEvent (org.eclipse.ecf.filetransfer.events.IRemoteFileSystemBrowseEvent)3 IRemoteFileAttributes (org.eclipse.ecf.filetransfer.IRemoteFileAttributes)2 IRemoteFileInfo (org.eclipse.ecf.filetransfer.IRemoteFileInfo)2 IFileID (org.eclipse.ecf.filetransfer.identity.IFileID)2 Session (com.jcraft.jsch.Session)1 URL (java.net.URL)1 UnknownHostException (java.net.UnknownHostException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 List (java.util.List)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 BrowseFileTransferException (org.eclipse.ecf.filetransfer.BrowseFileTransferException)1