src/java/fr/jayasoft/ivy/repository/ssh/AbstractSshBasedRepository.java
/**
     * Just check the uri for sanity
     * @param source String of the uri
     * @return URI object of the String or null
     */
Just check the uri for sanity
@param source String of the uri
@return URI object of the String or null
Just check the uri for sanity @param source String of the uri @return URI object of the String or null
private URI parseURI(String source) {
        try {
            URI uri = new URI(source);
            if(uri.getScheme() != null && !uri.getScheme().equalsIgnoreCase(getRepositoryScheme()))
                throw new URISyntaxException(source,"Wrong scheme in URI. Expected "+getRepositoryScheme()+" as scheme!");
            if(uri.getHost() == null && getHost() == null)
                throw new URISyntaxException(source,"Missing host in URI or in resolver");
            if(uri.getPath() == null)
                throw new URISyntaxException(source,"Missing path in URI");
            if(uri.getUserInfo() == null && getUser() == null)
                throw new URISyntaxException(source,"Missing username in URI or in resolver");
            return uri;
        } catch (URISyntaxException e) {
            Message.error(e.getMessage());
            Message.error("The uri is in the wrong format.");
            Message.error("Please use scheme://user:pass@hostname/path/to/repository");
            return null;
        }
    }
private URI parseURI ( String source ) { try { URI uri = new URI ( source ) ; if ( uri . getScheme ( ) != null && ! uri . getScheme ( ) . equalsIgnoreCase ( getRepositoryScheme ( ) ) ) throw new URISyntaxException ( source , "Wrong scheme in URI. Expected " + getRepositoryScheme ( ) + " as scheme!" ) ; if ( uri . getHost ( ) == null && getHost ( ) == null ) throw new URISyntaxException ( source , "Missing host in URI or in resolver" ) ; if ( uri . getPath ( ) == null ) throw new URISyntaxException ( source , "Missing path in URI" ) ; if ( uri . getUserInfo ( ) == null && getUser ( ) == null ) throw new URISyntaxException ( source , "Missing username in URI or in resolver" ) ; return uri ; } catch ( URISyntaxException e ) { Message . error ( e . getMessage ( ) ) ; Message . error ( "The uri is in the wrong format." ) ; Message . error ( "Please use scheme://user:pass@hostname/path/to/repository" ) ; return null ; } }
Just check the uri for sanity
 @param source String of the uri
 @return URI object of the String or null
Just check the uri for sanity @param source String of the uri @return URI object of the String or null