Author: ggregory
Date: Sun Feb 18 19:54:48 2018
New Revision: 1824697

URL: http://svn.apache.org/viewvc?rev=1824697&view=rev
Log:
Fix compiler warnings.

Modified:
    
commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileContentInfoFactory.java

Modified: 
commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileContentInfoFactory.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileContentInfoFactory.java?rev=1824697&r1=1824696&r2=1824697&view=diff
==============================================================================
--- 
commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileContentInfoFactory.java
 (original)
+++ 
commons/proper/vfs/trunk/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileContentInfoFactory.java
 Sun Feb 18 19:54:48 2018
@@ -34,13 +34,13 @@ import org.apache.commons.vfs2.util.File
 public class HttpFileContentInfoFactory implements FileContentInfoFactory {
     @Override
     public FileContentInfo create(final FileContent fileContent) throws 
FileSystemException {
-        final HttpFileObject httpFile = (HttpFileObject) 
FileObjectUtils.getAbstractFileObject(fileContent.getFile());
 
         String contentType = null;
         String contentEncoding = null;
 
         HeadMethod headMethod;
-        try {
+        try (final HttpFileObject<HttpFileSystem> httpFile = 
(HttpFileObject<HttpFileSystem>) FileObjectUtils
+                .getAbstractFileObject(fileContent.getFile())) {
             headMethod = httpFile.getHeadMethod();
         } catch (final IOException e) {
             throw new FileSystemException(e);


Reply via email to