You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Benoit Callebaut (JIRA)" <ji...@apache.org> on 2006/05/27 12:29:30 UTC

[jira] Commented: (VFS-39) [VFS] read/write XML support

    [ http://issues.apache.org/jira/browse/VFS-39?page=comments#action_12413574 ] 

Benoit Callebaut commented on VFS-39:
-------------------------------------

I don't understand why you think so. An XML File is not a filesystem by itself like an Tar file but itsstructure is the same as for a "normal" filesystem. It is a tree with folders and leaf elements.
And by the way, it is in the TO DO list 

> [VFS] read/write XML support
> ----------------------------
>
>          Key: VFS-39
>          URL: http://issues.apache.org/jira/browse/VFS-39
>      Project: Commons VFS
>         Type: Improvement

>     Versions: Nightly Builds
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Benoit Callebaut
>     Priority: Minor
>  Attachments: VFSXmlFileObject.java, VFSXmlFileProvider.java, VFSXmlFileSystem.java, package.html, patchfile, test.xml
>
> Here is the patch and necessary files for adding XML support for VFS.
> I don't know how to include new files in a patch, so I will put them on the
> mailing list.
> I am not a test writer specialist, so there is no specific test case for this
> provider but I tested it and it works.
> Index: vfs/src/test/org/apache/commons/vfs/RunTest.java
> ===================================================================
> --- vfs/src/test/org/apache/commons/vfs/RunTest.java    (revision 404758)
> +++ vfs/src/test/org/apache/commons/vfs/RunTest.java    (working copy)
> @@ -26,6 +26,7 @@
>  import org.apache.commons.vfs.provider.url.test.UrlProviderHttpTestCase;
>  import org.apache.commons.vfs.provider.test.VirtualProviderTestCase;
>  import org.apache.commons.vfs.provider.test.GenericFileNameTestCase;
> +import org.apache.commons.vfs.provider.xml.test.XmlProviderTestCase;
>  import java.util.Properties;
> @@ -67,6 +68,7 @@
>                 // WebdavProviderTestCase.suite(),
>                 SftpProviderTestCase.suite(),
> +               XmlProviderTestCase.suite(),
>                 // JarProviderTestCase.suite(),
>                 // NestedJarTestCase.suite(),
> Index: vfs/src/java/org/apache/commons/vfs/impl/providers.xml
> ===================================================================
> --- vfs/src/java/org/apache/commons/vfs/impl/providers.xml      (revision 404758)
> +++ vfs/src/java/org/apache/commons/vfs/impl/providers.xml      (working copy)
> @@ -51,6 +51,9 @@
>      <provider
> class-name="org.apache.commons.vfs.provider.res.ResourceFileProvider">
>          <scheme name="res"/>
>      </provider>
> +    <provider class-name="org.apache.commons.vfs.provider.xml.VFSXmlFileProvider">
> +        <scheme name="xml"/>
> +    </provider>
>      <!--
>          <provider class-name="org.apache.commons.vfs.provider.tar.TgzFileProvider">
>              <scheme name="tgz"/>
> @@ -78,8 +81,10 @@
>          <scheme name="ram"/>
>      </provider>
> +    <extension-map extension="xml" scheme="xml"/>
>      <extension-map extension="zip" scheme="zip"/>
>      <extension-map extension="tar" scheme="tar"/>
> +    <mime-type-map mime-type="application/xml" scheme="xml"/>
>      <mime-type-map mime-type="application/zip" scheme="zip"/>
>      <mime-type-map mime-type="application/x-tar" scheme="tar"/>
>      <mime-type-map mime-type="application/x-gzip" scheme="gz"/>
> Index: vfs/src/java/org/apache/commons/vfs/FileType.java
> ===================================================================
> --- vfs/src/java/org/apache/commons/vfs/FileType.java   (revision 404758)
> +++ vfs/src/java/org/apache/commons/vfs/FileType.java   (working copy)
> @@ -46,7 +46,7 @@
>      private final boolean hasContent;
>      private final boolean hasAttrs;
> -    private FileType(final String name,
> +    public FileType(final String name,
>                       final boolean hasChildren,
>                       final boolean hasContent,
>                       final boolean hasAttrs)
> @@ -96,4 +96,14 @@
>      {
>          return hasAttrs;
>      }
> +
> +    public boolean equals(Object obj){
> +        if (!(obj instanceof FileType)) return false;
> +        FileType ob = (FileType)obj;
> +        if (this.hasContent() && ob.hasContent()) return true;
> +        if (this.hasChildren() && ob.hasChildren()) return true;
> +        if (this.hasAttributes() && ob.hasAttributes()) return true;
> +
> +        return false;
> +    }
>  }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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