public void upload ( IProgressMonitor monitor , final File file ) throws IOException { if ( file . isDirectory ( ) ) { Path filePath = new Path ( this . path , file . getName ( ) ) ; getDFS ( ) . mkdirs ( filePath ) ; DFSFolder newFolder = new DFSFolder ( this , filePath ) ; monitor . worked ( 1 ) ; for ( File child : file . listFiles ( ) ) { if ( monitor . isCanceled ( ) ) return ; newFolder . upload ( monitor , child ) ; } } else if ( file . isFile ( ) ) { Path filePath = new Path ( this . path , file . getName ( ) ) ; DFSFile newFile = new DFSFile ( this , filePath , file , monitor ) ; } else { // XXX don't know what the file is? } }
Upload the given file or directory into this DfsFolder