Author: imario
Date: Fri Nov 10 14:41:35 2006
New Revision: 473549

URL: http://svn.apache.org/viewvc?view=rev&rev=473549
Log:
new filesystem: mime

read mails and their attachements as if they are a files and/or folders

Added:
    
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileContentInfoFactory.java
   (with props)
    
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileObject.java
   (with props)
    
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileProvider.java
   (with props)
    
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileSystem.java
   (with props)
    
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/util/
    
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/util/FileObjectDataSource.java
   (with props)
Modified:
    
jakarta/commons/proper/vfs/trunk/sandbox/src/main/resources/META-INF/vfs-providers.xml

Added: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileContentInfoFactory.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileContentInfoFactory.java?view=auto&rev=473549
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileContentInfoFactory.java
 (added)
+++ 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileContentInfoFactory.java
 Fri Nov 10 14:41:35 2006
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs.provider.mime;
+
+import org.apache.commons.vfs.FileContentInfoFactory;
+import org.apache.commons.vfs.FileContentInfo;
+import org.apache.commons.vfs.FileContent;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.impl.DefaultFileContentInfo;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.ContentType;
+
+/**
+ * get access to the content info stuff for mime objects
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
+ * @version $Revision$ $Date$
+ */
+public class MimeFileContentInfoFactory implements FileContentInfoFactory
+{
+       public FileContentInfo create(FileContent fileContent) throws 
FileSystemException
+       {
+               MimeFileObject mimeFile = (MimeFileObject) 
fileContent.getFile();
+
+               ContentType contentType;
+               try
+               {
+                       String contentTypeString = 
mimeFile.getPart().getContentType();
+                       contentType = new ContentType(contentTypeString);
+               }
+               catch (MessagingException e)
+               {
+                       throw new FileSystemException(e);
+               }
+
+               return new DefaultFileContentInfo(contentType.getBaseType(), 
contentType.getParameter("charset"));
+       }
+}

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileContentInfoFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileContentInfoFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileContentInfoFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileObject.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileObject.java?view=auto&rev=473549
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileObject.java
 (added)
+++ 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileObject.java
 Fri Nov 10 14:41:35 2006
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs.provider.mime;
+
+import org.apache.commons.vfs.FileContentInfoFactory;
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.FileType;
+import org.apache.commons.vfs.provider.AbstractFileObject;
+
+import javax.mail.Header;
+import javax.mail.MessagingException;
+import javax.mail.Part;
+import javax.mail.Multipart;
+import javax.mail.internet.MimeMessage;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * A part of a MIME message.
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
+ * @version $Revision$ $Date$
+ */
+public class MimeFileObject
+       extends AbstractFileObject
+       implements FileObject
+{
+       private final HashSet children = new HashSet();
+       private final Part part;
+       private final MimeFileSystem fileSystem;
+
+       protected MimeFileObject(final FileName name,
+                                                       final Part bodyPart,
+                                                       final MimeFileSystem 
fileSystem) throws FileSystemException
+       {
+               super(name, fileSystem);
+               this.part = bodyPart;
+               this.fileSystem = fileSystem;
+       }
+
+       /**
+        * Attaches a child
+        */
+       protected void attachChild(FileName childName)
+       {
+               children.add(childName.getBaseName());
+       }
+
+       /**
+     * Attaches this file object to its file resource.
+     */
+    protected void doAttach() throws Exception
+    {
+    }
+
+    protected void doDetach() throws Exception
+    {
+    }
+
+    /**
+     * Determines the type of the file, returns null if the file does not
+     * exist.
+     */
+    protected FileType doGetType() throws Exception
+    {
+               if (part == null)
+               {
+                       return FileType.IMAGINARY;
+               }
+
+               return FileType.FILE_OR_FOLDER;
+    }
+
+    /**
+     * Lists the children of the file.  Is only called if [EMAIL PROTECTED] 
#doGetType}
+     * returns [EMAIL PROTECTED] org.apache.commons.vfs.FileType#FOLDER}.
+     */
+    protected String[] doListChildren() throws Exception
+    {
+               return (String[]) children.toArray(new String[children.size()]);
+       }
+
+    /**
+     * Returns the size of the file content (in bytes).
+     */
+    protected long doGetContentSize() throws Exception
+    {
+               return part.getSize();
+       }
+
+    /**
+     * Returns the last modified time of this file.
+     */
+    protected long doGetLastModifiedTime()
+        throws Exception
+    {
+               MimeMessage mm = fileSystem.getMimeMessage();
+               if (mm.getSentDate() != null)
+               {
+                       return mm.getSentDate().getTime();
+               }
+               if (mm.getReceivedDate() != null)
+               {
+                       mm.getReceivedDate();
+               }
+               return 0;
+       }
+
+    /**
+     * Creates an input stream to read the file content from.
+     */
+    protected InputStream doGetInputStream() throws Exception
+    {
+               return part.getInputStream();
+       }
+
+       protected FileContentInfoFactory getFileContentInfoFactory()
+       {
+               return new MimeFileContentInfoFactory();
+       }
+
+       protected Part getPart()
+       {
+               return part;
+       }
+
+       /**
+        * Returns all headers of this part.<br />
+        * The map key is a java.lang.String and the value is a:<br />
+        * <ul>
+        * <li>java.lang.Strings for single entries</li>
+        * or a
+        * <li>java.utils.List of java.lang.Strings for entries with multiple 
values</li>
+        * </ul>
+        */
+       protected Map doGetAttributes() throws Exception
+       {
+               Map ret = new TreeMap();
+
+               Enumeration headers = getAllHeaders();
+               while (headers.hasMoreElements())
+               {
+                       Header header = (Header) headers.nextElement();
+                       Object values = ret.get(header.getName());
+
+                       if (values == null)
+                       {
+                               ret.put(header.getName(), header.getValue());
+                       }
+                       else if (values instanceof String)
+                       {
+                               List newValues = new ArrayList();
+                               newValues.add(values);
+                               newValues.add(header.getValue());
+                               ret.put(header.getName(), newValues);
+                       }
+                       else if (values instanceof List)
+                       {
+                               ((List) values).add(header.getValue());
+                       }
+               }
+
+               return ret;
+       }
+
+       protected Enumeration getAllHeaders() throws MessagingException
+       {
+               return part.getAllHeaders();
+       }
+}

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileObject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileObject.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileProvider.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileProvider.java?view=auto&rev=473549
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileProvider.java
 (added)
+++ 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileProvider.java
 Fri Nov 10 14:41:35 2006
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs.provider.mime;
+
+import org.apache.commons.vfs.Capability;
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystem;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.FileSystemOptions;
+import org.apache.commons.vfs.FileType;
+import org.apache.commons.vfs.provider.AbstractLayeredFileProvider;
+import org.apache.commons.vfs.provider.FileProvider;
+import org.apache.commons.vfs.provider.LayeredFileName;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * A provider for MIME Message.
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
+ * @version $Revision$ $Date$
+ */
+public class MimeFileProvider
+       extends AbstractLayeredFileProvider
+       implements FileProvider
+{
+    protected final static Collection capabilities = 
Collections.unmodifiableCollection(Arrays.asList(new Capability[]
+    {
+        Capability.GET_TYPE,
+        Capability.GET_LAST_MODIFIED,
+        Capability.LIST_CHILDREN,
+        Capability.READ_CONTENT,
+        Capability.URI,
+               Capability.ATTRIBUTES
+    }));
+
+       public MimeFileProvider()
+    {
+        super();
+    }
+
+    /**
+     * Creates the filesystem.
+     */
+    protected FileSystem doCreateFileSystem(String scheme, final FileObject 
file, final FileSystemOptions fileSystemOptions)
+        throws FileSystemException
+       {
+               final FileName name =
+                       new LayeredFileName(scheme, file.getName(), 
FileName.ROOT_PATH, FileType.FOLDER);
+        return new MimeFileSystem(name, file, fileSystemOptions);
+    }
+
+    public Collection getCapabilities()
+    {
+        return capabilities;
+    }
+}

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileProvider.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileSystem.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileSystem.java?view=auto&rev=473549
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileSystem.java
 (added)
+++ 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileSystem.java
 Fri Nov 10 14:41:35 2006
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs.provider.mime;
+
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystem;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.FileSystemOptions;
+import org.apache.commons.vfs.util.FileObjectDataSource;
+import org.apache.commons.vfs.provider.AbstractFileSystem;
+import org.apache.commons.vfs.provider.UriParser;
+
+import javax.mail.internet.MimeMultipart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.MessagingException;
+import javax.mail.BodyPart;
+import javax.mail.Multipart;
+import java.util.Collection;
+import java.util.List;
+import java.util.ArrayList;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * An MIME file system.
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
+ * @version $Revision$ $Date$
+ */
+public class MimeFileSystem
+       extends AbstractFileSystem
+       implements FileSystem
+{
+       private final static String NULL_BP_NAME = "_body_part_";
+
+       private MimeMultipart mimeMultipart;
+       private MimeMessage mimeMessage;
+
+       protected MimeFileSystem(final FileName rootName, final FileObject 
parentLayer, final FileSystemOptions fileSystemOptions)
+    {
+        super(rootName, parentLayer, fileSystemOptions);
+       }
+
+       public void init() throws FileSystemException
+       {
+               super.init();
+
+               List strongRef = new ArrayList(100);
+
+               // check if parent exists
+               if (!getParentLayer().exists())
+               {
+                       return;
+               }
+               
+               try
+               {
+                       InputStream is = null;
+                       try
+                       {
+                               is = 
getParentLayer().getContent().getInputStream();
+                               mimeMessage = new MimeMessage(null, is);
+                       }
+                       finally
+                       {
+                               if (is != null)
+                               {
+                                       try
+                                       {
+                                               is.close();
+                                       }
+                                       catch (IOException e)
+                                       {
+                                               // ignore close errors
+                                       }
+                               }
+                       }
+
+                       // create root
+                       FileName name = 
getFileSystemManager().resolveName(getRootName(), "/");
+                       MimeFileObject foRoot = new MimeFileObject(name, 
mimeMessage, this);
+                       putFileToCache(foRoot);
+                       strongRef.add(foRoot);
+                       foRoot.holdObject(strongRef);
+
+                       Object content;
+                       try
+                       {
+                               content = mimeMessage.getContent();
+                       }
+                       catch (IOException e)
+                       {
+                               throw new FileSystemException(e);
+                       }
+
+                       if (content instanceof Multipart)
+                       {
+                               // yes ... get all children
+                               mimeMultipart = new MimeMultipart(new 
FileObjectDataSource(getParentLayer()));
+
+                               for (int i = 0; i< mimeMultipart.getCount(); 
i++)
+                               {
+                                       BodyPart bp = 
mimeMultipart.getBodyPart(i);
+
+                                       String filename = 
UriParser.encode(bp.getFileName());
+                                       if (filename == null)
+                                       {
+                                               filename = NULL_BP_NAME + i;
+                                       }
+
+                                       name = 
getFileSystemManager().resolveName(getRootName(), filename);
+                                       MimeFileObject fo = new 
MimeFileObject(name, bp, this);
+
+                                       putFileToCache(fo);
+                                       strongRef.add(fo);
+                                       fo.holdObject(strongRef);
+
+                                       MimeFileObject parent;
+                                       for (FileName parentName = 
name.getParent();
+                                                parentName != null;
+                                                fo = parent, parentName = 
parentName.getParent())
+                                       {
+                                               // Locate the parent
+                                               parent = (MimeFileObject) 
getFileFromCache(parentName);
+                                               if (parent == null)
+                                               {
+                                                       parent = new 
MimeFileObject(name, null, this);
+                                                       putFileToCache(parent);
+                                                       strongRef.add(parent);
+                                                       
parent.holdObject(strongRef);
+                                               }
+
+                                               // Attach child to parent
+                                               
parent.attachChild(fo.getName());
+                                       }
+                               }
+                       }
+               }
+               catch (MessagingException e)
+               {
+                       throw new FileSystemException(e);
+               }
+
+       }
+
+       /**
+     * Creates a file object.
+     */
+    protected FileObject createFile(final FileName name) throws 
FileSystemException
+       {
+        return new MimeFileObject(name, null, this);
+    }
+
+    /**
+     * Returns the capabilities of this file system.
+     */
+    protected void addCapabilities(final Collection caps)
+    {
+        caps.addAll(MimeFileProvider.capabilities);
+    }
+
+       protected MimeMultipart getMimeMultipart()
+       {
+               return mimeMultipart;
+       }
+
+       protected MimeMessage getMimeMessage()
+       {
+               return mimeMessage;
+       }
+}

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileSystem.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileSystem.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/mime/MimeFileSystem.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/util/FileObjectDataSource.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/util/FileObjectDataSource.java?view=auto&rev=473549
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/util/FileObjectDataSource.java
 (added)
+++ 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/util/FileObjectDataSource.java
 Fri Nov 10 14:41:35 2006
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.vfs.util;
+
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystemException;
+
+import javax.activation.DataSource;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * Provide access to a FileObject as DataSource
+ */
+public class FileObjectDataSource implements DataSource
+{
+       private final FileObject fo;
+
+       public FileObjectDataSource(FileObject fo)
+       {
+               this.fo = fo;
+       }
+
+       public InputStream getInputStream() throws IOException
+       {
+               return fo.getContent().getInputStream();
+       }
+
+       public OutputStream getOutputStream() throws IOException
+       {
+               return fo.getContent().getOutputStream();
+       }
+
+       public String getContentType()
+       {
+               try
+               {
+                       return 
fo.getContent().getContentInfo().getContentType();
+               }
+               catch (FileSystemException e)
+               {
+                       throw new RuntimeException(e);
+               }
+       }
+
+       public String getName()
+       {
+               return fo.getName().getBaseName();
+       }
+}

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/util/FileObjectDataSource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/util/FileObjectDataSource.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/util/FileObjectDataSource.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/resources/META-INF/vfs-providers.xml
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/sandbox/src/main/resources/META-INF/vfs-providers.xml?view=diff&rev=473549&r1=473548&r2=473549
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/resources/META-INF/vfs-providers.xml
 (original)
+++ 
jakarta/commons/proper/vfs/trunk/sandbox/src/main/resources/META-INF/vfs-providers.xml
 Fri Nov 10 14:41:35 2006
@@ -11,4 +11,12 @@
                <if-available 
class-name="org.apache.commons.httpclient.HttpClient"/>
        </provider>
        
+       <provider 
class-name="org.apache.commons.vfs.provider.mime.MimeFileProvider">
+               <scheme name="mime"/>
+               <if-available class-name="javax.mail.internet.MimeMultipart"/>
+       </provider>
+
+       <extension-map extension="mime" scheme="mime"/>
+       <mime-type-map mime-type="message/rfc822" scheme="mime"/>
+
 </providers>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to