public static FileDirectoryAttributes getFileDirectoryAttributes ( final HttpURLConnection request , final boolean usePathStyleUris ) throws StorageException { final FileDirectoryAttributes directoryAttributes = new FileDirectoryAttributes ( ) ; URI tempURI ; try { tempURI = PathUtility . stripSingleURIQueryAndFragment ( request . getURL ( ) . toURI ( ) ) ; } catch ( final URISyntaxException e ) { final StorageException wrappedUnexpectedException = Utility . generateNewUnexpectedStorageException ( e ) ; throw wrappedUnexpectedException ; } directoryAttributes . setName ( PathUtility . getDirectoryNameFromURI ( tempURI , usePathStyleUris ) ) ; final FileDirectoryProperties directoryProperties = directoryAttributes . getProperties ( ) ; directoryProperties . setEtag ( BaseResponse . getEtag ( request ) ) ; directoryProperties . setLastModified ( new Date ( request . getLastModified ( ) ) ) ; directoryAttributes . setMetadata ( getMetadata ( request ) ) ; directoryProperties . setServerEncrypted ( Constants . TRUE . equals ( request . getHeaderField ( Constants . HeaderConstants . SERVER_ENCRYPTED ) ) ) ; return directoryAttributes ; }
Gets the FileDirectoryAttributes from the given request .