@Override public Boolean call() { try { return file.isDirectory(); } catch (final SmbException e) { return Boolean.FALSE; } } }).call(timeout).booleanValue();
/** * Get directory listing of file or smb url * respects the hidden attribute of a directory (return null if hidden) * * @return names of files and directories or null * @throws IOException */ public String[] list() throws IOException { if (isFile() && !isHidden()) return getFSFile().list(); if (isSMB()) try { final SmbFile sf = getSmbFile(); if (!sf.isDirectory() || sf.isHidden()) return null; try { return TimeoutRequest.list(sf, SMB_TIMEOUT); } catch (final SmbException e) { throw new IOException("SMB.list SmbException for " + sf.toString() + ": " + e.getMessage()); } } catch (final MalformedURLException e) { throw new IOException("SMB.list MalformedURLException for " + toNormalform(false) + ": " + e.getMessage()); } return null; }
@Override public boolean isDirectory() { try { return file.isDirectory(); } catch(SmbException e) { return false; } }
@Override protected boolean isDirectory(SmbFile file) { try { return file.isDirectory(); } catch (SmbException e) { throw new UncheckedIOException(e); } }
@Override protected boolean isDirectory(SmbFile file) { try { return file.isDirectory(); } catch (SmbException e) { throw new UncheckedIOException(e); } }
protected int compareNames( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } return f1name.compareToIgnoreCase( f2.getName() ); } protected int compareSizes( SmbFile f1, String f1name, SmbFile f2 ) throws IOException {
protected int compareNames( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } return f1name.compareToIgnoreCase( f2.getName() ); } protected int compareSizes( SmbFile f1, String f1name, SmbFile f2 ) throws IOException {
protected int compareNames ( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if ( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } return f1name.compareToIgnoreCase(f2.getName()); }
protected int compareNames( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } return f1name.compareToIgnoreCase( f2.getName() ); } protected int compareSizes( SmbFile f1, String f1name, SmbFile f2 ) throws IOException {
protected int compareNames ( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if ( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } return f1name.compareToIgnoreCase(f2.getName()); }
protected int compareDates ( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if ( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } if ( f1.isDirectory() ) { return f1name.compareToIgnoreCase(f2.getName()); } return f1.lastModified() > f2.lastModified() ? -1 : 1; }
protected int compareDates( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } if( f1.isDirectory() ) { return f1name.compareToIgnoreCase( f2.getName() ); } return f1.lastModified() > f2.lastModified() ? -1 : 1; } protected void doDirectory( HttpServletRequest req, HttpServletResponse resp, SmbFile dir ) throws IOException {
protected int compareDates ( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if ( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } if ( f1.isDirectory() ) { return f1name.compareToIgnoreCase(f2.getName()); } return f1.lastModified() > f2.lastModified() ? -1 : 1; }
protected int compareDates( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } if( f1.isDirectory() ) { return f1name.compareToIgnoreCase( f2.getName() ); } return f1.lastModified() > f2.lastModified() ? -1 : 1; } protected void doDirectory( HttpServletRequest req, HttpServletResponse resp, SmbFile dir ) throws IOException {
protected int compareDates( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } if( f1.isDirectory() ) { return f1name.compareToIgnoreCase( f2.getName() ); } return f1.lastModified() > f2.lastModified() ? -1 : 1; } protected void doDirectory( HttpServletRequest req, HttpServletResponse resp, SmbFile dir ) throws IOException {
protected int compareDates( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { if( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } if( f1.isDirectory() ) { return f1name.compareToIgnoreCase( f2.getName() ); } return f1.lastModified() > f2.lastModified() ? -1 : 1; } protected void doDirectory( HttpServletRequest req, HttpServletResponse resp, SmbFile dir ) throws IOException {
/** * Checks whether the remote resource is a directory. * @param _path remote path * @return true if resource is a directory, false otherwise * @throws IOException on error conditions returned by a CIFS server */ public boolean isDirectory(String _path) throws IOException { SmbFile resource = createSmbFileObject(_path); return resource.exists() && resource.isDirectory(); }
/** * Lists the children of the file. Is only called if {@link #doGetType} returns {@link FileType#FOLDER}. */ @Override protected String[] doListChildren() throws Exception { // VFS-210: do not try to get listing for anything else than directories if (!file.isDirectory()) { return null; } return UriParser.encode(file.list()); }
void copyRecursive ( SmbFile dest, byte[][] b, int bsize, WriterThread w, SmbTreeHandleImpl sh, SmbTreeHandleImpl dh ) throws CIFSException { if ( isDirectory() ) { SmbCopyUtil.copyDir(this, dest, b, bsize, w, sh, dh); } else { SmbCopyUtil.copyFile(this, dest, b, bsize, w, sh, dh); } dest.clearAttributeCache(); }
void copyRecursive ( SmbFile dest, byte[][] b, int bsize, WriterThread w, SmbTreeHandleImpl sh, SmbTreeHandleImpl dh ) throws CIFSException { if ( isDirectory() ) { SmbCopyUtil.copyDir(this, dest, b, bsize, w, sh, dh); } else { SmbCopyUtil.copyFile(this, dest, b, bsize, w, sh, dh); } dest.clearAttributeCache(); }