void connect0() throws SmbException { try { connect(); } catch( UnknownHostException uhe ) { throw new SmbException( "Failed to connect to server", uhe ); } catch( SmbException se ) { throw se; } catch( IOException ioe ) { throw new SmbException( "Failed to connect to server", ioe ); } } void doConnect() throws IOException {
public boolean isDirectory() throws IOException { if (isFile()) return getFSFile().isDirectory(); if (isSMB()) try { return TimeoutRequest.isDirectory(getSmbFile(), SMB_TIMEOUT); } catch (final SmbException e) { throw new IOException("SMB.isDirectory SmbException (" + e.getMessage() + ") for " + toNormalform(false)); } catch (final MalformedURLException e) { throw new IOException("SMB.isDirectory MalformedURLException (" + e.getMessage() + ") for " + toNormalform(false)); } return false; }
/** * * @param errcode * @param winerr */ public SmbException ( int errcode, boolean winerr ) { super(winerr ? getMessageByWinerrCode(errcode) : getMessageByCode(errcode)); this.status = winerr ? errcode : getStatusByCode(errcode); }
SmbException( int errcode, Throwable rootCause ) { super( getMessageByCode( errcode )); status = getStatusByCode( errcode ); this.rootCause = rootCause; } SmbException( String msg ) {
@Override public void setLastModified ( long time ) throws SmbException { if ( this.fileLocator.isRootOrShare() ) { throw new SmbException("Invalid operation for workgroups, servers, or shares"); } try { setPathInformation(0, 0L, time, 0L); } catch ( CIFSException e ) { throw SmbException.wrap(e); } }
public Object[] winreg_QueryValue(JIPolicyHandle handle,String valueName,int bufferSize) throws JIException { queryValue queryvalue = new queryValue(); queryvalue.parentKey = handle; queryvalue.bufferLength = bufferSize; queryvalue.key = valueName; try { call(Endpoint.IDEMPOTENT,queryvalue); } catch(SmbException e){ throw new JIException(e.getNtStatus(),e); } catch (IOException e) { throw new JIException(JIErrorCodes.RPC_E_UNEXPECTED,e); } catch (JIRuntimeException e) { throw new JIException(e); } return new Object[]{new Integer(queryvalue.type),(queryvalue.buffer != null ? (Object)queryvalue.buffer : (Object)queryvalue.buffer2)}; }
dest.setPathInformation( attributes, createTime, lastModified ); } catch( SmbException se ) { if( se.getNtStatus() != NtStatus.NT_STATUS_ACCESS_DENIED && se.getNtStatus() != NtStatus.NT_STATUS_OBJECT_NAME_COLLISION ) { throw se; throw new SmbException( url.toString(), uhe ); } catch( MalformedURLException mue ) { throw new SmbException( url.toString(), mue ); w.wait(); } catch( InterruptedException ie ) { throw new SmbException( dest.url.toString(), ie ); throw new SmbException("Failed to copy file from [" + this.toString() + "] to [" + dest.toString() + "]", se); se.printStackTrace( log ); } finally { close();
public static NtlmChallenge getChallengeForDomain() throws SmbException, UnknownHostException { if( DOMAIN == null ) { throw new SmbException( "A domain was not specified" ); SmbTransport.log.println( "Failed validate DC: " + dc_list[i] ); if (SmbTransport.log.level > 2) se.printStackTrace( SmbTransport.log );
} catch( SmbException se ) { if( log.level > 2 ) se.printStackTrace( log ); if( se.getNtStatus() != se.NT_STATUS_UNSUCCESSFUL ) { throw se;
@Override public void setAttributes ( int attrs ) throws SmbException { if ( this.fileLocator.isRootOrShare() ) { throw new SmbException("Invalid operation for workgroups, servers, or shares"); } try { setPathInformation(attrs & ATTR_SET_MASK, 0L, 0L, 0L); } catch ( SmbException e ) { if ( e.getNtStatus() != 0xC00000BB ) { throw e; } throw new SmbUnsupportedOperationException("Attribute not supported by server"); } catch ( CIFSException e ) { throw SmbException.wrap(e); } }
e.printStackTrace(listener.error(e.getMessage())); } catch (JIException e) { if(e.getErrorCode()==5)
void checkStatus( ServerMessageBlock req, ServerMessageBlock resp ) throws SmbException { resp.errorCode = SmbException.getStatusByCode( resp.errorCode ); switch( resp.errorCode ) { case NtStatus.NT_STATUS_OK: case NtStatus.NT_STATUS_PATH_NOT_COVERED: if( req.auth == null ) { throw new SmbException( resp.errorCode, null ); throw new SmbException(resp.errorCode, null); break; /* normal for NTLMSSP */ default: throw new SmbException( resp.errorCode, null ); throw new SmbException( "Signature verification failed." );
protected IOException seToIoe(SmbException se) { IOException ioe = se; Throwable root = se.getRootCause(); if (root instanceof TransportException) { ioe = (TransportException)root; root = ((TransportException)ioe).getRootCause(); } if (root instanceof InterruptedException) { ioe = new InterruptedIOException(root.getMessage()); ioe.initCause(root); } return ioe; }
public Object[] winreg_QueryValue(JIPolicyHandle handle,String valueName,int bufferSize) throws JIException { queryValue queryvalue = new queryValue(); queryvalue.parentKey = handle; queryvalue.bufferLength = bufferSize; queryvalue.key = valueName; try { call(Endpoint.IDEMPOTENT,queryvalue); } catch(SmbException e){ throw new JIException(e.getNtStatus(),e); } catch (IOException e) { throw new JIException(JIErrorCodes.RPC_E_UNEXPECTED,e); } catch (JIRuntimeException e) { throw new JIException(e); } return new Object[]{new Integer(queryvalue.type),(queryvalue.buffer != null ? (Object)queryvalue.buffer : (Object)queryvalue.buffer2)}; }
dest.setPathInformation( attributes, createTime, lastModified ); } catch( SmbException se ) { if( se.getNtStatus() != NtStatus.NT_STATUS_ACCESS_DENIED && se.getNtStatus() != NtStatus.NT_STATUS_OBJECT_NAME_COLLISION ) { throw se; throw new SmbException( url.toString(), uhe ); } catch( MalformedURLException mue ) { throw new SmbException( url.toString(), mue ); w.wait(); } catch( InterruptedException ie ) { throw new SmbException( dest.url.toString(), ie ); throw new SmbException("Failed to copy file from [" + this.toString() + "] to [" + dest.toString() + "]", se); se.printStackTrace( log ); } finally { close();
public static NtlmChallenge getChallengeForDomain() throws SmbException, UnknownHostException { if( DOMAIN == null ) { throw new SmbException( "A domain was not specified" ); SmbTransport.log.println( "Failed validate DC: " + dc_list[i] ); if (SmbTransport.log.level > 2) se.printStackTrace( SmbTransport.log );
} catch( SmbException se ) { if( log.level > 2 ) se.printStackTrace( log ); if( se.getNtStatus() != se.NT_STATUS_UNSUCCESSFUL ) { throw se;
void treeDisconnect( boolean inError ) { synchronized (session.transport()) { if (connectionState != 2) // not-connected return; connectionState = 3; // disconnecting if (!inError && tid != 0) { try { send( new SmbComTreeDisconnect(), null ); } catch( SmbException se ) { if (session.transport.log.level > 1) { se.printStackTrace( session.transport.log ); } } } inDfs = false; inDomainDfs = false; connectionState = 0; session.transport.notifyAll(); } }
/** * * @param errcode * @param rootCause */ public SmbException ( int errcode, Throwable rootCause ) { super(getMessageByCode(errcode), rootCause); this.status = getStatusByCode(errcode); }