@Override public Long call() { try { return file.length(); } catch (final SmbException e) { return Long.valueOf(0); } } }).call(timeout).longValue();
public long length() { if (isFile()) try { return getFSFile().length(); } catch (final Throwable e) { return -1; } if (isSMB()) try { return getSmbFile().length(); //return TimeoutRequest.length(getSmbFile(), SMB_TIMEOUT); // a timeout request is a bad idea, that will create a lot of concurrent threads during crawling } catch (final Throwable e) { return -1; } return -1; }
/** * Returns the size of the file content (in bytes). */ @Override protected long doGetContentSize() throws Exception { return file.length(); }
/** * This URLConnection method just returns the result of <tt>length()</tt>. * * @return the length of this file or 0 if it refers to a directory */ public int getContentLength() { try { return (int)(length() & 0xFFFFFFFFL); } catch( SmbException se ) { } return 0; }
/** * This URLConnection method just returns the result of <tt>length()</tt>. * * @return the length of this file or 0 if it refers to a directory */ public int getContentLength() { try { return (int)(length() & 0xFFFFFFFFL); } catch( SmbException se ) { } return 0; }
@Override public long getSize() { try { return file.length(); } catch(SmbException e) { return 0; } }
/** * Returns the size of the file content (in bytes). */ @Override protected long doGetContentSize() throws Exception { return file.length(); }
/** * This URLConnection method just returns the result of <tt>length()</tt>. * * @return the length of this file or 0 if it refers to a directory */ public int getContentLength() { try { return (int)(length() & 0xFFFFFFFFL); } catch( SmbException se ) { } return 0; }
/** * This URLConnection method just returns the result of <tt>length()</tt>. * * @return the length of this file or 0 if it refers to a directory */ public int getContentLength() { try { return (int)(length() & 0xFFFFFFFFL); } catch( SmbException se ) { } return 0; }
public long length() throws SmbException { return file.length(); } public void setLength( long newLength ) throws SmbException {
public long length() throws SmbException { return file.length(); } public void setLength( long newLength ) throws SmbException {
@Override public long length () throws SmbException { return this.file.length(); }
public long length() throws SmbException { return file.length(); } public void setLength( long newLength ) throws SmbException {
@Override public long length () throws SmbException { return this.file.length(); }
void ensureOpen() throws IOException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, access | SmbConstants.FILE_WRITE_DATA, SmbFile.ATTR_NORMAL, 0 ); if( append ) { fp = file.length(); } } } /**
void ensureOpen() throws IOException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, access | SmbConstants.FILE_WRITE_DATA, SmbFile.ATTR_NORMAL, 0 ); if( append ) { fp = file.length(); } } } /**
void ensureOpen() throws IOException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, access | SmbConstants.FILE_WRITE_DATA, SmbFile.ATTR_NORMAL, 0 ); if( append ) { fp = file.length(); } } } /**
void ensureOpen() throws IOException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, access | SmbConstants.FILE_WRITE_DATA, SmbFile.ATTR_NORMAL, 0 ); if( append ) { fp = file.length(); } } } /**
protected int compareSizes( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { long diff; if( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } if( f1.isDirectory() ) { return f1name.compareToIgnoreCase( f2.getName() ); } diff = f1.length() - f2.length(); if( diff == 0 ) { return f1name.compareToIgnoreCase( f2.getName() ); } return diff > 0 ? -1 : 1; } protected int compareTypes( SmbFile f1, String f1name, SmbFile f2 ) throws IOException {
protected int compareSizes ( SmbFile f1, String f1name, SmbFile f2 ) throws IOException { long diff; if ( f1.isDirectory() != f2.isDirectory() ) { return f1.isDirectory() ? -1 : 1; } if ( f1.isDirectory() ) { return f1name.compareToIgnoreCase(f2.getName()); } diff = f1.length() - f2.length(); if ( diff == 0 ) { return f1name.compareToIgnoreCase(f2.getName()); } return diff > 0 ? -1 : 1; }