CPD Results

The following document contains the results of PMD's CPD 3.7.

Duplications

FileLine
org/millscript/commons/vfs/protocols/http/HttpFolder.java68
org/millscript/commons/vfs/protocols/http/HttpFolder.java129
    public HttpFolder checkVFolder( final String segment ) {
        final StringBuffer uri = this.appendAbsolutePath( new StringBuffer() ).append( segment );
        final String uriAsFile = uri.toString();
        final String uriAsFolder = uri.append( '/' ).toString();
        final HttpVolume vol = this.getVolume();
        // Try to get the segment as a folder
        Request request = vol.httpConnection.newRequest( "HEAD", uriAsFolder );
        // Execute the method and capture the resulting status code
        Response response = vol.dispatch( request );
        switch ( response.getCode() ) {
            case 200:
                // There is an entry with the segment name and a / at the end
                // so it must be a folder
                return new HttpFolder( this, segment );
            case 404:
                // Not found, so lets just check if its available as a file
                request = vol.httpConnection.newRequest( "HEAD", uriAsFile );
                // Execute the method and capture the resulting status code
                response = vol.dispatch( request );
                // Now check the status code
                if ( response.getCode() == 200 ) {