core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
/**
     * Determines the type of this file.  Must not return null.  The return
     * value of this method is cached, so the implementation can be expensive.
     */
Determines the type of this file.  Must not return null.  The return
value of this method is cached, so the implementation can be expensive.
Determines the type of this file . Must not return null . The return value of this method is cached so the implementation can be expensive .
@Override
    protected FileType doGetType() throws Exception
    {
        method = new HeadMethod();
        setupMethod(method);
        final HttpClient client = fileSystem.getClient();
        final int status = client.executeMethod(method);
        method.releaseConnection();
        if (status == HttpURLConnection.HTTP_OK)
        {
            return FileType.FILE;
        }
        else if (status == HttpURLConnection.HTTP_NOT_FOUND
            || status == HttpURLConnection.HTTP_GONE)
        {
            return FileType.IMAGINARY;
        }
        else
        {
            throw new FileSystemException("vfs.provider.http/head.error", getName());
        }
    }
@ Override protected FileType doGetType ( ) throws Exception { method = new HeadMethod ( ) ; setupMethod ( method ) ; final HttpClient client = fileSystem . getClient ( ) ; final int status = client . executeMethod ( method ) ; method . releaseConnection ( ) ; if ( status == HttpURLConnection . HTTP_OK ) { return FileType . FILE ; } else if ( status == HttpURLConnection . HTTP_NOT_FOUND || status == HttpURLConnection . HTTP_GONE ) { return FileType . IMAGINARY ; } else { throw new FileSystemException ( "vfs.provider.http/head.error" , getName ( ) ) ; } }
Determines the type of this file.
Determines the type of this file .
// Use the HEAD method to probe the file.