idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
121,800
public String [ ] getAllGlobusID ( String userID ) { if ( userID == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "userIdNull" ) ) ; } if ( this . map == null ) { return null ; } Vector v = new Vector ( ) ; Iterator iter = this . map . entrySet ( ) . iterator ( ) ; Map . Entry mapEntry ; GridMapEntr...
Returns all globus IDs associated with the specified local user name .
121,801
public void invoke ( X509Certificate cert , GSIConstants . CertificateType certType ) throws CertPathValidatorException { try { cert . checkValidity ( ) ; } catch ( CertificateExpiredException e ) { throw new CertPathValidatorException ( "Certificate " + cert . getSubjectDN ( ) + " expired" , e ) ; } catch ( Certificat...
Method that checks the time validity . Uses the standard Certificate . checkValidity method .
121,802
public CredentialInfo info ( GSSCredential credential , String username , String passphrase ) throws MyProxyException { InfoParams request = new InfoParams ( ) ; request . setUserName ( username ) ; request . setPassphrase ( passphrase ) ; return info ( credential , request ) [ 0 ] ; }
Retrieves credential information from MyProxy server . Only the information of the default credential is returned by this operation .
121,803
public void getTrustroots ( GSSCredential credential , GetTrustrootsParams params ) throws MyProxyException { if ( params == null ) { throw new IllegalArgumentException ( "params == null" ) ; } if ( credential == null ) { try { credential = getAnonymousCredential ( ) ; } catch ( GSSException e ) { throw new MyProxyExce...
Retrieves trustroot information from the MyProxy server .
121,804
public boolean writeTrustRoots ( String directory ) throws IOException { if ( this . trustrootFilenames == null || this . trustrootData == null ) { return false ; } File rootDir = new File ( directory ) ; if ( ! rootDir . exists ( ) ) { rootDir . mkdirs ( ) ; } for ( int i = 0 ; i < trustrootFilenames . length ; i ++ )...
Writes the retrieved trust roots to a trusted certificates directory .
121,805
protected static String toHex ( final byte [ ] bin ) { if ( bin == null || bin . length == 0 ) return "" ; char [ ] buffer = new char [ bin . length * 2 ] ; final char [ ] hex = "0123456789abcdef" . toCharArray ( ) ; for ( int i = 0 , j = 0 ; i < bin . length ; i ++ ) { final byte b = bin [ i ] ; buffer [ j ++ ] = hex ...
encode binary to hex
121,806
public Key engineGetKey ( String s , char [ ] chars ) throws NoSuchAlgorithmException , UnrecoverableKeyException { CredentialWrapper credential = getKeyEntry ( s ) ; Key key = null ; if ( credential != null ) { try { String password = null ; if ( chars != null ) { password = new String ( chars ) ; } key = credential ....
Get the key referenced by the specified alias .
121,807
public void engineStore ( OutputStream outputStream , char [ ] chars ) throws IOException , NoSuchAlgorithmException , CertificateException { for ( SecurityObjectWrapper < ? > object : this . aliasObjectMap . values ( ) ) { if ( object instanceof Storable ) { try { ( ( Storable ) object ) . store ( ) ; } catch ( Resour...
Persist the security material in this keystore . If the object has a path associated with it the object will be persisted to that path . Otherwise it will be stored in the default certificate directory . As a result the parameters of this method are ignored .
121,808
public Date engineGetCreationDate ( String s ) { try { ResourceTrustAnchor trustAnchor = getCertificateEntry ( s ) ; if ( trustAnchor != null ) { return trustAnchor . getTrustAnchor ( ) . getTrustedCert ( ) . getNotBefore ( ) ; } else { CredentialWrapper credential = getKeyEntry ( s ) ; if ( credential != null ) { retu...
Get the creation date for the object referenced by the alias .
121,809
public Certificate [ ] engineGetCertificateChain ( String s ) { CredentialWrapper credential = getKeyEntry ( s ) ; X509Certificate [ ] chain = new X509Certificate [ 0 ] ; if ( credential != null ) { try { chain = credential . getCredential ( ) . getCertificateChain ( ) ; } catch ( ResourceStoreException e ) { logger . ...
Get the certificateChain for the key referenced by the alias .
121,810
public Certificate engineGetCertificate ( String s ) { ResourceTrustAnchor trustAnchor = getCertificateEntry ( s ) ; if ( trustAnchor != null ) { try { return trustAnchor . getTrustAnchor ( ) . getTrustedCert ( ) ; } catch ( ResourceStoreException e ) { return null ; } } return null ; }
Get the certificate referenced by the supplied alias .
121,811
public void engineLoad ( KeyStore . LoadStoreParameter loadStoreParameter ) throws IOException , NoSuchAlgorithmException , CertificateException { if ( ! ( loadStoreParameter instanceof KeyStoreParametersFactory . FileStoreParameters ) ) { throw new IllegalArgumentException ( "Unable to process parameters: " + loadStor...
Load the keystore based on parameters in the LoadStoreParameter . The parameter object must be an instance of FileBasedKeyStoreParameters .
121,812
private void initialize ( String defaultDirectoryString , String directoryListString , String proxyFilename , String certFilename , String keyFilename ) throws IOException , CertificateException { if ( defaultDirectoryString != null ) { defaultDirectory = new GlobusPathMatchingResourcePatternResolver ( ) . getResource ...
Initialize resources from filename proxyfile name
121,813
public void engineDeleteEntry ( String s ) throws KeyStoreException { SecurityObjectWrapper < ? > object = this . aliasObjectMap . remove ( s ) ; if ( object != null ) { if ( object instanceof ResourceTrustAnchor ) { ResourceTrustAnchor descriptor = ( ResourceTrustAnchor ) object ; Certificate cert ; try { cert = descr...
Delete a security object from this keystore .
121,814
public void engineSetKeyEntry ( String s , Key key , char [ ] chars , Certificate [ ] certificates ) throws KeyStoreException { if ( ! ( key instanceof PrivateKey ) ) { throw new KeyStoreException ( "PrivateKey expected" ) ; } if ( ! ( certificates instanceof X509Certificate [ ] ) ) { throw new KeyStoreException ( "Cer...
Add a new private key to the keystore .
121,815
public void engineSetCertificateEntry ( String alias , Certificate certificate ) throws KeyStoreException { if ( ! ( certificate instanceof X509Certificate ) ) { throw new KeyStoreException ( "Certificate must be instance of X509Certificate" ) ; } File file ; ResourceTrustAnchor trustAnchor = getCertificateEntry ( alia...
Add a certificate to the keystore .
121,816
public static boolean isProxy ( GSIConstants . CertificateType certType ) { return isGsi2Proxy ( certType ) || isGsi3Proxy ( certType ) || isGsi4Proxy ( certType ) ; }
Determines if a specified certificate type indicates a GSI - 2 GSI - 3 or GSI - 4proxy certificate .
121,817
public static boolean isGsi4Proxy ( GSIConstants . CertificateType certType ) { return certType == GSIConstants . CertificateType . GSI_4_IMPERSONATION_PROXY || certType == GSIConstants . CertificateType . GSI_4_INDEPENDENT_PROXY || certType == GSIConstants . CertificateType . GSI_4_RESTRICTED_PROXY || certType == GSIC...
Determines if a specified certificate type indicates a GSI - 4 proxy certificate .
121,818
public static boolean isGsi3Proxy ( GSIConstants . CertificateType certType ) { return certType == GSIConstants . CertificateType . GSI_3_IMPERSONATION_PROXY || certType == GSIConstants . CertificateType . GSI_3_INDEPENDENT_PROXY || certType == GSIConstants . CertificateType . GSI_3_RESTRICTED_PROXY || certType == GSIC...
Determines if a specified certificate type indicates a GSI - 3 proxy certificate .
121,819
public static boolean isGsi2Proxy ( GSIConstants . CertificateType certType ) { return certType == GSIConstants . CertificateType . GSI_2_PROXY || certType == GSIConstants . CertificateType . GSI_2_LIMITED_PROXY ; }
Determines if a specified certificate type indicates a GSI - 2 proxy certificate .
121,820
public static boolean isLimitedProxy ( GSIConstants . CertificateType certType ) { return certType == GSIConstants . CertificateType . GSI_3_LIMITED_PROXY || certType == GSIConstants . CertificateType . GSI_2_LIMITED_PROXY || certType == GSIConstants . CertificateType . GSI_4_LIMITED_PROXY ; }
Determines if a specified certificate type indicates a GSI - 2 or GSI - 3 or GSI = 4 limited proxy certificate .
121,821
public static boolean isIndependentProxy ( GSIConstants . CertificateType certType ) { return certType == GSIConstants . CertificateType . GSI_3_INDEPENDENT_PROXY || certType == GSIConstants . CertificateType . GSI_4_INDEPENDENT_PROXY ; }
Determines if a specified certificate type indicates a GSI - 3 or GS - 4 limited proxy certificate .
121,822
public static boolean isImpersonationProxy ( GSIConstants . CertificateType certType ) { return certType == GSIConstants . CertificateType . GSI_3_IMPERSONATION_PROXY || certType == GSIConstants . CertificateType . GSI_3_LIMITED_PROXY || certType == GSIConstants . CertificateType . GSI_4_IMPERSONATION_PROXY || certType...
Determines if a specified certificate type indicates a GSI - 2 or GSI - 3 or GSI - 4 impersonation proxy certificate .
121,823
public static String getProxyTypeAsString ( GSIConstants . CertificateType proxyType ) { switch ( proxyType ) { case GSI_4_IMPERSONATION_PROXY : return "RFC 3820 compliant impersonation proxy" ; case GSI_4_INDEPENDENT_PROXY : return "RFC 3820 compliant independent proxy" ; case GSI_4_LIMITED_PROXY : return "RFC 3820 co...
Returns a string description of a specified proxy type .
121,824
public Map < X500Principal , SigningPolicy > parse ( String fileName ) throws FileNotFoundException , SigningPolicyException { if ( ( fileName == null ) || ( fileName . trim ( ) . isEmpty ( ) ) ) { throw new IllegalArgumentException ( ) ; } logger . debug ( "Signing policy file name " + fileName ) ; FileReader fileRead...
Parses the file to extract signing policy defined for CA with the specified DN . If the policy file does not exist a SigningPolicy object with only CA DN is created . If policy path exists but no relevant policy exisit SigningPolicy object with CA DN and file path is created .
121,825
public Map < X500Principal , SigningPolicy > parse ( Reader reader ) throws SigningPolicyException { Map < X500Principal , SigningPolicy > policies = new HashMap < X500Principal , SigningPolicy > ( ) ; BufferedReader bufferedReader = new BufferedReader ( reader ) ; try { String line ; while ( ( line = bufferedReader . ...
Parses input stream to extract signing policy defined for CA with the specified DN .
121,826
private int findIndex ( String line ) { int index = - 1 ; if ( line == null ) { return index ; } String trimmedLine = line . trim ( ) ; int spaceIndex = trimmedLine . indexOf ( " " ) ; int tabIndex = trimmedLine . indexOf ( "\t" ) ; if ( spaceIndex != - 1 ) { if ( tabIndex != - 1 ) { if ( spaceIndex < tabIndex ) { inde...
find first space or tab as separator .
121,827
public static CertStore createCertStore ( TrustedCertificates tc ) throws Exception { CertStore store = null ; if ( tc == null ) { String caCertPattern = "file:" + CoGProperties . getDefault ( ) . getCaCertLocations ( ) + "/*.0" ; store = Stores . getCACertStore ( caCertPattern ) ; } else { SimpleMemoryCertStoreParams ...
Create a CertStore object from TrustedCertificates . The store only loads trusted certificates no signing policies
121,828
public ProxyPolicyHandler removeProxyPolicyHandler ( String id ) { return ( id != null && this . proxyPolicyHandlers != null ) ? ( ProxyPolicyHandler ) this . proxyPolicyHandlers . remove ( id ) : null ; }
Removes a restricted proxy policy handler .
121,829
public ProxyPolicyHandler setProxyPolicyHandler ( String id , ProxyPolicyHandler handler ) { if ( id == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "proxyPolicyId" ) ) ; } if ( handler == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "proxyPolicyHandler" ) ) ; } if ( this . pro...
Sets a restricted proxy policy handler .
121,830
public ProxyPolicyHandler getProxyPolicyHandler ( String id ) { return ( id != null && this . proxyPolicyHandlers != null ) ? ( ProxyPolicyHandler ) this . proxyPolicyHandlers . get ( id ) : null ; }
Retrieves a restricted proxy policy handler for a given policy id .
121,831
public void activeConnect ( HostPort hp , int connections ) { for ( int i = 0 ; i < connections ; i ++ ) { SocketBox sbox = new ManagedSocketBox ( ) ; logger . debug ( "adding new empty socketBox to the socket pool" ) ; socketPool . add ( sbox ) ; logger . debug ( "connecting active socket " + i + "; total cached socke...
Act as the active side . Connect to the server and store the newly connected sockets in the socketPool .
121,832
public void activeClose ( TransferContext context , int connections ) { try { for ( int i = 0 ; i < connections ; i ++ ) { SocketBox sbox = socketPool . checkOut ( ) ; try { GridFTPDataChannel dc = new GridFTPDataChannel ( gSession , sbox ) ; EBlockImageDCWriter writer = ( EBlockImageDCWriter ) dc . getDataChannelSink ...
use only in mode E
121,833
public synchronized void startTransfer ( DataSource source , TransferContext context , int connections , boolean reusable ) throws ServerException { if ( transferThreadCount != 0 ) { throw new ServerException ( ServerException . PREVIOUS_TRANSFER_ACTIVE ) ; } for ( int i = 0 ; i < connections ; i ++ ) { logger . debug ...
This should be used once the remote active server connected to us . This method starts transfer threads that will read data from the source and send .
121,834
public synchronized void passiveConnect ( DataSink sink , TransferContext context , int connections , ServerSocket serverSocket ) throws ServerException { if ( transferThreadCount != 0 ) { throw new ServerException ( ServerException . PREVIOUS_TRANSFER_ACTIVE ) ; } for ( int i = 0 ; i < connections ; i ++ ) { Task task...
Accept connections from the remote server and start transfer threads that will read incoming data and store in the sink .
121,835
public synchronized void passiveConnect ( DataSource source , TransferContext context , ServerSocket serverSocket ) throws ServerException { if ( transferThreadCount != 0 ) { throw new ServerException ( ServerException . PREVIOUS_TRANSFER_ACTIVE ) ; } Task task = new GridFTPPassiveConnectTask ( serverSocket , source , ...
Accept connection from the remote server and start transfer thread that will read incoming data and store in the sink . This method because of direction of transfer cannot be used with EBlock . Therefore it is fixed to create only 1 connection .
121,836
public static KeyStore buildTrustStore ( String provider , String trustAnchorStoreType , String trustAnchorStoreLocation , String trustAnchorStorePassword ) throws GlobusSSLConfigurationException { try { KeyStore trustAnchorStore ; if ( provider == null ) { trustAnchorStore = KeyStore . getInstance ( trustAnchorStoreTy...
Create a trust store using the supplied details . Java SSL requires the trust store to be supplied as a java . security . KeyStore so this will create a KeyStore containing all of the Trust Anchors .
121,837
public static KeyStore findCredentialStore ( String provider , String credentialStoreType , String credentialStoreLocation , String credentialStorePassword ) throws GlobusSSLConfigurationException { try { KeyStore credentialStore ; if ( provider == null ) { credentialStore = KeyStore . getInstance ( credentialStoreType...
Create a configured CredentialStore using the supplied parameters . The credential store is a java . security . KeyStore .
121,838
public static CertStore findCRLStore ( String crlPattern ) throws GlobusSSLConfigurationException { try { return Stores . getCRLStore ( crlPattern ) ; } catch ( InvalidAlgorithmParameterException e ) { throw new GlobusSSLConfigurationException ( e ) ; } catch ( NoSuchAlgorithmException e ) { Log logger = LogFactory . g...
Create a store of Certificate Revocation Lists . Java requires that this be a java . security . certificates . CertStore . As such the store can hold both CRL s and non - trusted certs . For the purposes of this method we assume that only crl s will be loaded . This can only be used with the Globus provided Certificate...
121,839
private String readLine ( InputStream in ) throws IOException { StringBuffer buf = new StringBuffer ( ) ; int c , length = 0 ; while ( true ) { c = in . read ( ) ; if ( c == - 1 || c == '\n' || length > 512 ) { break ; } else if ( c == '\r' ) { in . read ( ) ; return buf . toString ( ) ; } else { buf . append ( ( char ...
Read a line of text from the given Stream and return it as a String . Assumes lines end in CRLF .
121,840
private static String getUsefulMessage ( Throwable throwable ) { while ( isBoring ( throwable ) ) { throwable = throwable . getCause ( ) ; } String message = throwable . getMessage ( ) ; if ( message == null ) { message = throwable . getClass ( ) . getName ( ) ; } return message ; }
Wrapper around getMessage method that tries to provide a meaningful message . This is needed because many GSSException objects provide no useful information and the actual useful information is in the Throwable that caused the exception .
121,841
public List < Feature > getFeature ( String label ) { if ( label == null ) { throw new IllegalArgumentException ( "feature label is null" ) ; } label = label . toUpperCase ( ) ; List < Feature > foundFeatures = new ArrayList ( ) ; for ( Feature feature : features ) { if ( feature . getLabel ( ) . equals ( label ) ) { f...
Get all features that have label equal to the argument Note that RFC 2389 does not require a feature with a given label to appear only once
121,842
public static String getOperatorAsString ( int op ) { switch ( op ) { case EQ : return "=" ; case NEQ : return "!=" ; case GT : return ">" ; case GTEQ : return ">=" ; case LT : return "<" ; case LTEQ : return "<=" ; default : return "??" ; } }
Returns a string representation of the specified relation operator .
121,843
public void add ( String [ ] strValues ) { if ( strValues == null ) return ; if ( values == null ) values = new LinkedList ( ) ; for ( int i = 0 ; i < strValues . length ; i ++ ) { values . add ( new Value ( strValues [ i ] ) ) ; } }
Adds an array of values to the list of values . Each element in the array is converted into a Value object and inserted as a separate value into the list of values .
121,844
public void add ( List list ) { if ( values == null ) values = new LinkedList ( ) ; values . add ( list ) ; }
Adds a list to the list of values . It is inserted as a single element .
121,845
public NameOpValue evaluate ( Map symbolTable ) throws RslEvaluationException { List list = evaluateSub ( values , symbolTable ) ; NameOpValue newNV = new NameOpValue ( getAttribute ( ) , getOperator ( ) ) ; newNV . setValues ( list ) ; return newNV ; }
Evaluates the relation against the symbol table .
121,846
protected static String ignoreLeading0 ( String line ) { if ( line . length ( ) > 0 && line . charAt ( 0 ) == 0 ) { logger . debug ( "WARNING: The first character of the reply is 0. Ignoring the character." ) ; return line . substring ( 1 , line . length ( ) ) ; } return line ; }
GT2 . 0 wuftp server incorrectly inserts \ 0 between lines . We have to deal with that .
121,847
protected Socket openSocket ( String host , int port ) throws IOException { return SocketFactory . getDefault ( ) . createSocket ( host , port ) ; }
subclasses should overwrite this function
121,848
public void verify ( ) throws Exception { Map < String , ProxyPolicyHandler > handlers = null ; if ( proxyCertInfo != null ) { String oid = proxyCertInfo . getProxyPolicy ( ) . getPolicyLanguage ( ) . getId ( ) ; handlers = new HashMap < String , ProxyPolicyHandler > ( ) ; handlers . put ( oid , new ProxyPolicyHandler ...
verifies the proxy credential
121,849
protected List < CertificateChecker > getCertificateCheckers ( ) { List < CertificateChecker > checkers = new ArrayList < CertificateChecker > ( ) ; checkers . add ( new DateValidityChecker ( ) ) ; checkers . add ( new UnsupportedCriticalExtensionChecker ( ) ) ; checkers . add ( new IdentityChecker ( this ) ) ; Certifi...
COMMENT enable the checkers again when ProxyPathValidator starts working!
121,850
public GSSCredential createCredential ( byte [ ] buff , int option , int lifetime , Oid mech , int usage ) throws GSSException { checkMechanism ( mech ) ; if ( buff == null || buff . length < 1 ) { throw new GlobusGSSException ( GSSException . FAILURE , GlobusGSSException . BAD_ARGUMENT , "invalidBuf" ) ; } if ( lifeti...
Imports a credential .
121,851
public static void checkMechanism ( Oid mech ) throws GSSException { if ( mech != null && ! mech . equals ( GSSConstants . MECH_OID ) ) { throw new GSSException ( GSSException . BAD_MECH ) ; } }
Checks if the specified mechanism matches the mechanism supported by this implementation .
121,852
public boolean add ( AbstractRslNode node ) { if ( _specifications == null ) _specifications = new LinkedList ( ) ; return _specifications . add ( node ) ; }
Adds a rsl parse tree to this node .
121,853
public boolean removeSpecification ( AbstractRslNode node ) { if ( _specifications == null || node == null ) return false ; return _specifications . remove ( node ) ; }
Removes a specific sub - specification tree from the sub - specification list .
121,854
public static String canonicalize ( String str ) { if ( str == null ) return null ; int length = str . length ( ) ; char ch ; StringBuffer buf = new StringBuffer ( length ) ; for ( int i = 0 ; i < length ; i ++ ) { ch = str . charAt ( i ) ; if ( ch == '_' ) continue ; buf . append ( Character . toLowerCase ( ch ) ) ; }...
Canonicalizes a string by removing any underscores and moving all characters to lowercase .
121,855
public void waitFor ( Flag flag , int waitDelay ) throws ServerException , IOException , InterruptedException { waitFor ( flag , waitDelay , WAIT_FOREVER ) ; }
Return when reply is waiting
121,856
public void setupMessageContextImpl ( MessageContext mc , Call call , AxisEngine engine ) throws AxisFault { if ( action != null ) { mc . setUseSOAPAction ( true ) ; mc . setSOAPActionURI ( action ) ; } if ( cookie != null ) mc . setProperty ( HTTPConstants . HEADER_COOKIE , cookie ) ; if ( cookie2 != null ) mc . setPr...
Set up any transport - specific derived properties in the message context .
121,857
public ASN1Primitive toASN1Primitive ( ) { ASN1EncodableVector vec = new ASN1EncodableVector ( ) ; vec . add ( this . policyLanguage ) ; if ( this . policy != null ) { vec . add ( this . policy ) ; } return new DERSequence ( vec ) ; }
Returns the DER - encoded ASN . 1 representation of proxy policy .
121,858
public String toFtpCmdArgument ( ) { StringBuffer msg = new StringBuffer ( ) ; msg . append ( "|" ) ; if ( this . version != null ) { msg . append ( this . version ) ; } msg . append ( "|" ) ; if ( this . host != null ) { msg . append ( this . host ) ; } msg . append ( "|" ) ; msg . append ( String . valueOf ( this . p...
Returns the host - port information in the format used by EPRT command . &lt ; d&gt ; &lt ; net - prt&gt ; &lt ; d&gt ; &lt ; net - addr&gt ; &lt ; d&gt ; &lt ; tcp - port&gt ; &lt ; d&gt ;
121,859
public static void shutdown ( GSSCredential cred , GlobusURL gassURL ) throws IOException , GSSException { OutputStream output = null ; InputStream input = null ; Socket socket = null ; try { if ( gassURL . getProtocol ( ) . equalsIgnoreCase ( "https" ) ) { GSSManager manager = ExtendedGSSManager . getInstance ( ) ; Ex...
Shutdowns a remote gass server . The server must have the CLIENT_SHUTDOWN option enabled for this to work .
121,860
private void transfer ( OutputStream os , String path ) throws IOException { path = decodeUrlPath ( path ) ; File f = new File ( path ) ; FileInputStream file = new FileInputStream ( f ) ; long length = f . length ( ) ; StringBuffer buf = new StringBuffer ( OKHEADER ) . append ( CONNECTION_CLOSE ) . append ( SERVER ) ....
Transfer from a file given its path to the given OutputStream . The BufferedWriter points to the same stream but is used to write HTTP header information .
121,861
private long fromHex ( String s ) { long result = 0 ; int size = s . length ( ) ; for ( int i = 0 ; i < size ; i ++ ) { char c = s . charAt ( i ) ; result *= 16 ; switch ( c ) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : result += ( c - '0' ) ; break ; ...
Convert a String representing a hex number to a long .
121,862
protected String makeRequest ( boolean includePassword ) { StringBuffer buf = new StringBuffer ( ) ; buf . append ( VERSION ) . append ( CRLF ) ; buf . append ( COMMAND ) . append ( String . valueOf ( command ) ) . append ( CRLF ) ; buf . append ( USERNAME ) . append ( this . username ) . append ( CRLF ) ; String pwd =...
Serializes the parameters into a MyProxy request . Subclasses should overwrite this function and append the custom parameters to the output of this function .
121,863
protected void engineInit ( KeyStore keyStore ) throws KeyStoreException { try { this . engineInit ( new CertPathTrustManagerParameters ( new X509ProxyCertPathParameters ( keyStore , null , null , false ) ) ) ; } catch ( InvalidAlgorithmParameterException e ) { throw new KeyStoreException ( e ) ; } }
Initializes this factory with a source of certificate authorities and related trust material .
121,864
public void setProtection ( int protection ) { switch ( protection ) { case GridFTPSession . PROTECTION_CLEAR : throw new IllegalArgumentException ( "Unsupported protection: " + protection ) ; case GridFTPSession . PROTECTION_SAFE : case GridFTPSession . PROTECTION_CONFIDENTIAL : case GridFTPSession . PROTECTION_PRIVAT...
Sets data channel protection level .
121,865
public boolean isValidSubject ( X500Principal subject ) { if ( subject == null ) { throw new IllegalArgumentException ( ) ; } String subjectDN = CertificateUtil . toGlobusID ( subject ) ; if ( ( this . allowedDNs == null ) || ( this . allowedDNs . size ( ) < 1 ) ) { return false ; } int size = this . allowedDNs . size ...
Ascertains if the subjectDN is valid against this policy .
121,866
public static String getIdentity ( X509Certificate cert ) { if ( cert == null ) { return null ; } String subjectDN = cert . getSubjectX500Principal ( ) . getName ( X500Principal . RFC2253 ) ; X509Name name = new X509Name ( true , subjectDN ) ; return X509NameHelper . toString ( name ) ; }
Returns the subject DN of the given certificate in the Globus format .
121,867
public static byte [ ] getExtensionValue ( byte [ ] certExtValue ) throws IOException { ByteArrayInputStream inStream = new ByteArrayInputStream ( certExtValue ) ; ASN1InputStream derInputStream = new ASN1InputStream ( inStream ) ; ASN1Primitive object = derInputStream . readObject ( ) ; if ( object instanceof ASN1Octe...
Retrieves the actual value of the X . 509 extension .
121,868
public static byte [ ] getExtensionValue ( X509Certificate cert , String oid ) throws IOException { if ( cert == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "certNull" ) ) ; } if ( oid == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "oidNull" ) ) ; } byte [ ] value = cert . ge...
Returns the actual value of the extension .
121,869
protected void parse ( ) throws IOException { String line ; line = _reader . readLine ( ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( line ) ; } parseHead ( line ) ; while ( ( line = _reader . readLine ( ) ) . length ( ) != 0 ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( line ) ; } if ( line . s...
Parses the typical HTTP header .
121,870
public long getSize ( String filename ) throws IOException , ServerException { if ( filename == null ) { throw new IllegalArgumentException ( "Required argument missing" ) ; } Command cmd = new Command ( "SIZE" , filename ) ; Reply reply = null ; try { reply = controlChannel . execute ( cmd ) ; return Long . parseLong ...
Returns the remote file size .
121,871
public Date getLastModified ( String filename ) throws IOException , ServerException { if ( filename == null ) { throw new IllegalArgumentException ( "Required argument missing" ) ; } Command cmd = new Command ( "MDTM" , filename ) ; Reply reply = null ; try { reply = controlChannel . execute ( cmd ) ; } catch ( FTPRep...
Returns last modification time of the specifed file .
121,872
public void changeDir ( String dir ) throws IOException , ServerException { if ( dir == null ) { throw new IllegalArgumentException ( "Required argument missing" ) ; } Command cmd = new Command ( "CWD" , dir ) ; try { controlChannel . execute ( cmd ) ; } catch ( FTPReplyParseException rpe ) { throw ServerException . em...
Changes the remote current working directory .
121,873
public void deleteFile ( String filename ) throws IOException , ServerException { if ( filename == null ) { throw new IllegalArgumentException ( "Required argument missing" ) ; } Command cmd = new Command ( "DELE" , filename ) ; try { controlChannel . execute ( cmd ) ; } catch ( FTPReplyParseException rpe ) { throw Ser...
Deletes the remote file .
121,874
public void rename ( String oldName , String newName ) throws IOException , ServerException { if ( oldName == null || newName == null ) { throw new IllegalArgumentException ( "Required argument missing" ) ; } Command cmd = new Command ( "RNFR" , oldName ) ; try { Reply reply = controlChannel . exchange ( cmd ) ; if ( !...
Renames remote directory .
121,875
public String getCurrentDir ( ) throws IOException , ServerException { Reply reply = null ; try { reply = controlChannel . execute ( Command . PWD ) ; } catch ( FTPReplyParseException rpe ) { throw ServerException . embedFTPReplyParseException ( rpe ) ; } catch ( UnexpectedReplyCodeException urce ) { throw ServerExcept...
Returns remote current working directory .
121,876
public void goUpDir ( ) throws IOException , ServerException { try { controlChannel . execute ( Command . CDUP ) ; } catch ( FTPReplyParseException rpe ) { throw ServerException . embedFTPReplyParseException ( rpe ) ; } catch ( UnexpectedReplyCodeException urce ) { throw ServerException . embedUnexpectedReplyCodeExcept...
Changes remote current working directory to the higher level .
121,877
public Vector list ( String filter , String modifier ) throws ServerException , ClientException , IOException { ByteArrayDataSink sink = new ByteArrayDataSink ( ) ; list ( filter , modifier , sink ) ; ByteArrayOutputStream received = sink . getData ( ) ; BufferedReader reader = new BufferedReader ( new StringReader ( r...
Performs remote directory listing with the specified filter and modifier . Sends LIST &lt ; modifier&gt ; &lt ; filter&gt ; command .
121,878
public void list ( String filter , String modifier , DataSink sink ) throws ServerException , ClientException , IOException { String arg = null ; if ( modifier != null ) { arg = modifier ; } if ( filter != null ) { arg = ( arg == null ) ? filter : arg + " " + filter ; } Command cmd = new Command ( "LIST" , arg ) ; perf...
Performs directory listing and writes the result to the supplied data sink . This method is allowed in ASCII mode only .
121,879
public Vector nlist ( String path ) throws ServerException , ClientException , IOException { ByteArrayDataSink sink = new ByteArrayDataSink ( ) ; nlist ( path , sink ) ; ByteArrayOutputStream received = sink . getData ( ) ; BufferedReader reader = new BufferedReader ( new StringReader ( received . toString ( ) ) ) ; Ve...
Performs remote directory listing on the given path . Sends NLST &lt ; path&gt ; command .
121,880
public MlsxEntry mlst ( String fileName ) throws IOException , ServerException { try { Reply reply = controlChannel . execute ( new Command ( "MLST" , fileName ) ) ; String replyMessage = reply . getMessage ( ) ; StringTokenizer replyLines = new StringTokenizer ( replyMessage , System . getProperty ( "line.separator" )...
Get info of a certain remote file in Mlsx format .
121,881
public void setType ( int type ) throws IOException , ServerException { localServer . setTransferType ( type ) ; String typeStr = null ; switch ( type ) { case Session . TYPE_IMAGE : typeStr = "I" ; break ; case Session . TYPE_ASCII : typeStr = "A" ; break ; case Session . TYPE_LOCAL : typeStr = "E" ; break ; case Sess...
Sets transfer type .
121,882
public void close ( boolean ignoreQuitReply ) throws IOException , ServerException { try { if ( ignoreQuitReply ) { controlChannel . write ( Command . QUIT ) ; } else { controlChannel . execute ( Command . QUIT ) ; } } catch ( FTPReplyParseException rpe ) { throw ServerException . embedFTPReplyParseException ( rpe ) ; ...
Closes connection . Sends QUIT and closes connection even if the server reply was not positive . Also closes the local server .
121,883
public FeatureList getFeatureList ( ) throws IOException , ServerException { if ( this . session . featureList != null ) { return this . session . featureList ; } Reply featReply = null ; try { featReply = controlChannel . execute ( Command . FEAT ) ; if ( featReply . getCode ( ) != 211 ) { throw ServerException . embe...
Returns list of features supported by remote server .
121,884
public HostPort setPassive ( ) throws IOException , ServerException { Reply reply = null ; try { reply = controlChannel . execute ( ( controlChannel . isIPv6 ( ) ) ? Command . EPSV : Command . PASV ) ; } catch ( UnexpectedReplyCodeException urce ) { throw ServerException . embedUnexpectedReplyCodeException ( urce ) ; }...
Sets remote server to passive server mode .
121,885
public void setActive ( HostPort hostPort ) throws IOException , ServerException { Command cmd = new Command ( ( controlChannel . isIPv6 ( ) ) ? "EPRT" : "PORT" , hostPort . toFtpCmdArgument ( ) ) ; try { controlChannel . execute ( cmd ) ; } catch ( UnexpectedReplyCodeException urce ) { throw ServerException . embedUne...
Sets remote server active telling it to connect to the given address .
121,886
public void setLocalActive ( ) throws ClientException , IOException { if ( session . serverAddress == null ) { throw new ClientException ( ClientException . CALL_PASSIVE_FIRST ) ; } try { localServer . setActive ( session . serverAddress ) ; } catch ( java . net . UnknownHostException e ) { throw new ClientException ( ...
Starts local server in active server mode .
121,887
public void setOptions ( Options opts ) throws IOException , ServerException { Command cmd = new Command ( "OPTS" , opts . toFtpCmdArgument ( ) ) ; try { controlChannel . execute ( cmd ) ; } catch ( FTPReplyParseException rpe ) { throw ServerException . embedFTPReplyParseException ( rpe ) ; } catch ( UnexpectedReplyCod...
Sets the supplied options to the server .
121,888
public void setRestartMarker ( RestartData restartData ) throws IOException , ServerException { Command cmd = new Command ( "REST" , restartData . toFtpCmdArgument ( ) ) ; Reply reply = null ; try { reply = controlChannel . exchange ( cmd ) ; } catch ( FTPReplyParseException e ) { throw ServerException . embedFTPReplyP...
Sets restart parameter of the next transfer .
121,889
public void authorize ( String user , String password ) throws IOException , ServerException { Reply userReply = null ; try { userReply = controlChannel . exchange ( new Command ( "USER" , user ) ) ; } catch ( FTPReplyParseException rpe ) { throw ServerException . embedFTPReplyParseException ( rpe ) ; } if ( Reply . is...
Performs user authorization with specified user and password .
121,890
public void transfer ( String remoteSrcFile , FTPClient destination , String remoteDstFile , boolean append , MarkerListener mListener ) throws IOException , ServerException , ClientException { session . matches ( destination . session ) ; if ( session . serverMode == Session . SERVER_DEFAULT ) { HostPort hp = destinat...
Performs third - party transfer between two servers .
121,891
protected void transferRun ( BasicClientControlChannel other , MarkerListener mListener ) throws IOException , ServerException , ClientException { TransferState transferState = transferBegin ( other , mListener ) ; transferWait ( transferState ) ; }
Actual transfer management . Transfer is controlled by two new threads listening to the two servers .
121,892
public Reply quote ( String command ) throws IOException , ServerException { Command cmd = new Command ( command ) ; return doCommand ( cmd ) ; }
Executes arbitrary operation on the server .
121,893
public void allocate ( long size ) throws IOException , ServerException { Command cmd = new Command ( "ALLO" , String . valueOf ( size ) ) ; Reply reply = null ; try { reply = controlChannel . execute ( cmd ) ; } catch ( UnexpectedReplyCodeException urce ) { throw ServerException . embedUnexpectedReplyCodeException ( u...
Reserve sufficient storage to accommodate the new file to be transferred .
121,894
protected void checkGETPUTSupport ( ) throws ServerException , IOException { if ( ! isFeatureSupported ( FeatureList . GETPUT ) ) { throw new ServerException ( ServerException . UNSUPPORTED_FEATURE ) ; } if ( controlChannel . isIPv6 ( ) ) { throw new ServerException ( ServerException . UNSUPPORTED_FEATURE , "Cannot use...
Throws ServerException if GFD . 47 GETPUT is not supported or cannot be used .
121,895
protected HostPort get127Reply ( ) throws ServerException , IOException , FTPReplyParseException { Reply reply = controlChannel . read ( ) ; if ( Reply . isTransientNegativeCompletion ( reply ) || Reply . isPermanentNegativeCompletion ( reply ) ) { throw ServerException . embedUnexpectedReplyCodeException ( new Unexpec...
Reads a GFD . 47 compliant 127 reply and extracts the port information from it .
121,896
private void issueGETPUT ( String command , boolean passive , HostPort port , int mode , String path ) throws IOException { Command cmd = new Command ( command , ( passive ? "pasv" : ( "port=" + port . toFtpCmdArgument ( ) ) ) + ";" + "path=" + path + ";" + ( mode > 0 ? "mode=" + getModeStr ( mode ) + ";" : "" ) ) ; co...
Writes a GFD . 47 compliant GET or PUT command to the control channel .
121,897
public String getChecksum ( String algorithm , String path ) throws ClientException , ServerException , IOException { return getChecksum ( algorithm , 0 , - 1 , path ) ; }
GridFTP v2 CKSM command for the whole file
121,898
public int getDelegationKeyCacheLifetime ( ) { int valueInt = 0 ; String valueStr = System . getProperty ( DELEGATION_KEY_CACHE_LIFETIME ) ; if ( valueStr != null && valueStr . length ( ) > 0 ) { int parsedvalueInt = Integer . parseInt ( valueStr ) ; if ( parsedvalueInt > 0 ) { valueInt = parsedvalueInt ; } } if ( valu...
Returns the delegation key cache lifetime for all delegations from this JVM . If this property is not set or set to zero or less no caching is done .
121,899
public long getCRLCacheLifetime ( ) { long value = getCertCacheLifetime ( ) ; String property = getProperty ( CRL_CACHE_LIFETIME ) ; if ( property != null && property . length ( ) > 0 ) { long parsedValue = Long . parseLong ( property ) ; if ( parsedValue > 0 ) { value = parsedValue ; } } property = System . getPropert...
Returns the CRL cache lifetime . If this property is set to zero or less no caching is done . The value is the number of milliseconds the CRLs are cached without checking for modifications on disk .