commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider DefaultURLConnection.java
Date Thu, 20 May 2004 19:43:22 GMT
imario      2004/05/20 12:43:22

  Modified:    vfs/src/java/org/apache/commons/vfs/provider
                        DefaultURLConnection.java
  Log:
  implement getHeaderField.
  
  Needet to make JEditorPane happy.
  
  Revision  Changes    Path
  1.10      +21 -0     jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/DefaultURLConnection.java
  
  Index: DefaultURLConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/DefaultURLConnection.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultURLConnection.java	10 May 2004 20:09:43 -0000	1.9
  +++ DefaultURLConnection.java	20 May 2004 19:43:22 -0000	1.10
  @@ -15,6 +15,7 @@
    */
   package org.apache.commons.vfs.provider;
   
  +import org.apache.commons.vfs.Capability;
   import org.apache.commons.vfs.FileContent;
   import org.apache.commons.vfs.FileSystemException;
   
  @@ -72,4 +73,24 @@
           return -1;
       }
   
  +    public String getHeaderField(String name)
  +    {
  +        try
  +        {
  +            if (content.getFile().getFileSystem().hasCapability(Capability.ATTRIBUTES))
  +            {
  +                String value = (String) content.getAttribute(name);
  +                if (value != null)
  +                {
  +                    return value;
  +                }
  +            }
  +
  +            return null;
  +        }
  +        catch (FileSystemException e)
  +        {
  +            throw new RuntimeException(e);
  +        }
  +    }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message