/** * @param fe * @return * @throws MalformedURLException */ @Override protected SmbResource adapt ( FileEntry e ) throws MalformedURLException { return new SmbFile( getParent(), e.getName(), true, SmbConstants.TYPE_FILESYSTEM, e.getAttributes(), e.createTime(), e.lastModified(), e.lastAccess(), e.length()); } }
private final boolean filter ( FileEntry fe ) { String name = fe.getName(); if ( this.nameFilter == null ) { return true; } try { if ( !this.nameFilter.accept(this.parent, name) ) { return false; } return true; } catch ( CIFSException e ) { log.error("Failed to apply name filter", e); return false; } }
/** * {@inheritDoc} * * @see jcifs.smb.DirFileEntryEnumIteratorBase#fetchMore() */ @SuppressWarnings ( "resource" ) @Override protected boolean fetchMore () throws CIFSException { FileEntry[] results = this.response.getResults(); SmbTreeHandleImpl th = getTreeHandle(); Smb2QueryDirectoryRequest query = new Smb2QueryDirectoryRequest(th.getConfig(), this.fileId); query.setFileName(this.getWildcard()); query.setFileIndex(results[ results.length - 1 ].getFileIndex()); query.setQueryFlags(Smb2QueryDirectoryRequest.SMB2_INDEX_SPECIFIED); try { Smb2QueryDirectoryResponse r = th.send(query); if ( r.getStatus() == NtStatus.NT_STATUS_NO_MORE_FILES ) { return false; } this.response = r; } catch ( SmbException e ) { if ( e.getNtStatus() == NtStatus.NT_STATUS_NO_MORE_FILES ) { log.debug("End of listing", e); return false; } throw e; } return true; }
private final boolean filter ( FileEntry fe ) { String name = fe.getName(); if ( this.nameFilter == null ) { return true; } try { if ( !this.nameFilter.accept(this.parent, name) ) { return false; } return true; } catch ( CIFSException e ) { log.error("Failed to apply name filter", e); return false; } }
/** * {@inheritDoc} * * @see jcifs.smb.DirFileEntryEnumIteratorBase#fetchMore() */ @SuppressWarnings ( "resource" ) @Override protected boolean fetchMore () throws CIFSException { FileEntry[] results = this.response.getResults(); SmbTreeHandleImpl th = getTreeHandle(); Smb2QueryDirectoryRequest query = new Smb2QueryDirectoryRequest(th.getConfig(), this.fileId); query.setFileName(this.getWildcard()); query.setFileIndex(results[ results.length - 1 ].getFileIndex()); query.setQueryFlags(Smb2QueryDirectoryRequest.SMB2_INDEX_SPECIFIED); try { Smb2QueryDirectoryResponse r = th.send(query); if ( r.getStatus() == NtStatus.NT_STATUS_NO_MORE_FILES ) { return false; } this.response = r; } catch ( SmbException e ) { if ( e.getNtStatus() == NtStatus.NT_STATUS_NO_MORE_FILES ) { log.debug("End of listing", e); return false; } throw e; } return true; }
/** * @param fe * @return * @throws MalformedURLException */ @Override protected SmbResource adapt ( FileEntry e ) throws MalformedURLException { return new SmbFile( getParent(), e.getName(), true, SmbConstants.TYPE_FILESYSTEM, e.getAttributes(), e.createTime(), e.lastModified(), e.lastAccess(), e.length()); } }
private final boolean filter ( FileEntry fe ) { String name = fe.getName(); if ( name.length() < 3 ) { int h = name.hashCode(); if ( h == SmbFile.HASH_DOT || h == SmbFile.HASH_DOT_DOT ) { if ( name.equals(".") || name.equals("..") ) return false; } } if ( this.nameFilter == null ) { return true; } try { if ( !this.nameFilter.accept(this.parent, name) ) { return false; } return true; } catch ( CIFSException e ) { log.error("Failed to apply name filter", e); return false; } }
for( int i = 0; i < resp.numEntries; i++ ) { FileEntry e = resp.results[i]; String name = e.getName(); if( name.length() < 3 ) { int h = name.hashCode(); e.getAttributes(), e.createTime(), e.lastModified(), e.length() ); if( ff != null && ff.accept( f ) == false ) { continue;
private final boolean filter ( FileEntry fe ) { String name = fe.getName(); if ( name.length() < 3 ) { int h = name.hashCode(); if ( h == SmbFile.HASH_DOT || h == SmbFile.HASH_DOT_DOT ) { if ( name.equals(".") || name.equals("..") ) return false; } } if ( this.nameFilter == null ) { return true; } try { if ( !this.nameFilter.accept(this.parent, name) ) { return false; } return true; } catch ( CIFSException e ) { log.error("Failed to apply name filter", e); return false; } }
for( int i = 0; i < resp.numEntries; i++ ) { FileEntry e = resp.results[i]; String name = e.getName(); if( name.length() < 3 ) { int h = name.hashCode(); e.getAttributes(), e.createTime(), e.lastModified(), e.length() ); if( ff != null && ff.accept( f ) == false ) { continue;
for( int i = 0; i < resp.numEntries; i++ ) { FileEntry e = resp.results[i]; String name = e.getName(); if( name.length() < 3 ) { int h = name.hashCode(); e.getAttributes(), e.createTime(), e.lastModified(), e.length() ); if( ff != null && ff.accept( f ) == false ) { continue;
while (iter.hasNext()) { e = (FileEntry)iter.next(); String name = e.getName(); if (fnf != null && fnf.accept(this, name) == false) continue; if (name.length() > 0) { SmbFile f = new SmbFile(this, name, e.getType(), ATTR_READONLY | ATTR_DIRECTORY, 0L, 0L, 0L ); if (ff != null && ff.accept(f) == false)
for( int i = 0; i < resp.numEntries; i++ ) { FileEntry e = resp.results[i]; String name = e.getName(); if( name.length() < 3 ) { int h = name.hashCode(); e.getAttributes(), e.createTime(), e.lastModified(), e.length() ); if( ff != null && ff.accept( f ) == false ) { continue;
while (iter.hasNext()) { e = (FileEntry)iter.next(); String name = e.getName(); if (fnf != null && fnf.accept(this, name) == false) continue; if (name.length() > 0) { SmbFile f = new SmbFile(this, name, e.getType(), ATTR_READONLY | ATTR_DIRECTORY, 0L, 0L, 0L ); if (ff != null && ff.accept(f) == false)