mirror of https://github.com/apache/jclouds.git
Issue 128: updated vfs to work inside of ant
git-svn-id: http://jclouds.googlecode.com/svn/trunk@2430 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
fa9b3f6c0a
commit
9c72dc8ada
|
@ -76,7 +76,6 @@
|
|||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>jclouds-log4j</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
|
|
|
@ -45,6 +45,8 @@ import org.jclouds.blobstore.BlobStoreContextFactory;
|
|||
import org.jclouds.domain.Credentials;
|
||||
import org.jclouds.http.HttpUtils;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.io.Resources;
|
||||
import com.google.inject.Module;
|
||||
|
||||
|
@ -62,9 +64,13 @@ public class BlobStoreFileProvider extends AbstractOriginatingFileProvider {
|
|||
public final static UserAuthenticationData.Type[] AUTHENTICATOR_TYPES = new UserAuthenticationData.Type[] {
|
||||
UserAuthenticationData.USERNAME, UserAuthenticationData.PASSWORD };
|
||||
|
||||
private final Module[] modules;
|
||||
private final Iterable<Module> modules;
|
||||
|
||||
public BlobStoreFileProvider(Module... modules) {
|
||||
public BlobStoreFileProvider() {
|
||||
this(ImmutableList.<Module> of());
|
||||
}
|
||||
|
||||
public BlobStoreFileProvider(Iterable<Module> modules) {
|
||||
this.modules = modules;
|
||||
setFileNameParser(new BlobStoreFileNameParser());
|
||||
}
|
||||
|
@ -90,8 +96,8 @@ public class BlobStoreFileProvider extends AbstractOriginatingFileProvider {
|
|||
.toChar(rootName.getUserName()))), UserAuthenticatorUtils
|
||||
.toString(UserAuthenticatorUtils.getData(authData,
|
||||
UserAuthenticationData.PASSWORD, UserAuthenticatorUtils
|
||||
.toChar(rootName.getPassword())))), modules)
|
||||
.getBlobStore();
|
||||
.toChar(rootName.getPassword())))),
|
||||
Iterables.toArray(modules, Module.class)).getBlobStore();
|
||||
} catch (IOException e) {
|
||||
throw new FileSystemException("vfs.provider.blobstore/properties.error", name, e);
|
||||
} finally {
|
||||
|
|
|
@ -0,0 +1,143 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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.
|
||||
-->
|
||||
<providers>
|
||||
<default-provider
|
||||
class-name="org.apache.commons.vfs.provider.url.UrlFileProvider">
|
||||
</default-provider>
|
||||
<provider
|
||||
class-name="org.apache.commons.vfs.provider.local.DefaultLocalFileProvider">
|
||||
<scheme name="file" />
|
||||
</provider>
|
||||
<provider
|
||||
class-name="org.jclouds.vfs.provider.blobstore.BlobStoreFileProvider">
|
||||
<scheme name="blobstore" />
|
||||
</provider>
|
||||
<provider class-name="org.apache.commons.vfs.provider.zip.ZipFileProvider">
|
||||
<scheme name="zip" />
|
||||
</provider>
|
||||
<provider class-name="org.apache.commons.vfs.provider.tar.TarFileProvider">
|
||||
<scheme name="tar" />
|
||||
<if-available
|
||||
class-name="org.apache.commons.vfs.provider.tar.TarInputStream" />
|
||||
</provider>
|
||||
|
||||
<provider class-name="org.apache.commons.vfs.provider.bzip2.Bzip2FileProvider">
|
||||
<scheme name="bz2" />
|
||||
<if-available
|
||||
class-name="org.apache.commons.vfs.provider.bzip2.CBZip2InputStream" />
|
||||
</provider>
|
||||
<provider class-name="org.apache.commons.vfs.provider.gzip.GzipFileProvider">
|
||||
<scheme name="gz" />
|
||||
</provider>
|
||||
|
||||
<provider class-name="org.apache.commons.vfs.provider.jar.JarFileProvider">
|
||||
<scheme name="jar" />
|
||||
<scheme name="sar" />
|
||||
<scheme name="ear" />
|
||||
<scheme name="par" />
|
||||
<scheme name="ejb3" />
|
||||
<scheme name="war" />
|
||||
</provider>
|
||||
<provider
|
||||
class-name="org.apache.commons.vfs.provider.temp.TemporaryFileProvider">
|
||||
<scheme name="tmp" />
|
||||
</provider>
|
||||
<provider class-name="org.apache.commons.vfs.provider.ftp.FtpFileProvider">
|
||||
<scheme name="ftp" />
|
||||
<if-available class-name="org.apache.commons.net.ftp.FTPFile" />
|
||||
</provider>
|
||||
<provider class-name="org.apache.commons.vfs.provider.http.HttpFileProvider">
|
||||
<scheme name="http" />
|
||||
<if-available class-name="org.apache.commons.httpclient.HttpClient" />
|
||||
</provider>
|
||||
<provider class-name="org.apache.commons.vfs.provider.https.HttpsFileProvider">
|
||||
<scheme name="https" />
|
||||
<if-available class-name="org.apache.commons.httpclient.HttpClient" />
|
||||
</provider>
|
||||
<provider class-name="org.apache.commons.vfs.provider.sftp.SftpFileProvider">
|
||||
<scheme name="sftp" />
|
||||
<if-available class-name="javax.crypto.Cipher" />
|
||||
<if-available class-name="com.jcraft.jsch.JSch" />
|
||||
</provider>
|
||||
<provider class-name="org.apache.commons.vfs.provider.res.ResourceFileProvider">
|
||||
<scheme name="res" />
|
||||
</provider>
|
||||
<provider
|
||||
class-name="org.apache.commons.vfs.provider.webdav.WebdavFileProvider">
|
||||
<scheme name="webdav" />
|
||||
<if-available class-name="org.apache.commons.httpclient.HttpClient" />
|
||||
<if-available
|
||||
class-name="org.apache.jackrabbit.webdav.client.methods.DavMethod" />
|
||||
</provider>
|
||||
<!--
|
||||
<provider
|
||||
class-name="org.apache.commons.vfs.provider.svn.SvnFileProvider">
|
||||
<scheme name="svnhttps"/> </provider>
|
||||
-->
|
||||
<!--
|
||||
<provider
|
||||
class-name="org.apache.commons.vfs.provider.tar.TgzFileProvider">
|
||||
<scheme name="tgz"/> <if-available scheme="gz"/> <if-available
|
||||
scheme="tar"/> </provider> <provider
|
||||
class-name="org.apache.commons.vfs.provider.tar.Tbz2FileProvider">
|
||||
<scheme name="tbz2"/> <if-available scheme="bz2"/> <if-available
|
||||
scheme="tar"/> </provider>
|
||||
-->
|
||||
<provider class-name="org.apache.commons.vfs.provider.tar.TarFileProvider">
|
||||
<scheme name="tgz" />
|
||||
<if-available scheme="gz" />
|
||||
<if-available scheme="tar" />
|
||||
</provider>
|
||||
<provider class-name="org.apache.commons.vfs.provider.tar.TarFileProvider">
|
||||
<scheme name="tbz2" />
|
||||
<if-available scheme="bz2" />
|
||||
<if-available scheme="tar" />
|
||||
</provider>
|
||||
|
||||
<provider class-name="org.apache.commons.vfs.provider.ram.RamFileProvider">
|
||||
<scheme name="ram" />
|
||||
</provider>
|
||||
|
||||
<extension-map extension="zip" scheme="zip" />
|
||||
<extension-map extension="tar" scheme="tar" />
|
||||
<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" />
|
||||
<!--
|
||||
<mime-type-map mime-type="application/x-tgz" scheme="tgz"/>
|
||||
-->
|
||||
<extension-map extension="jar" scheme="jar" />
|
||||
<extension-map extension="bz2" scheme="bz2" />
|
||||
<extension-map extension="gz" scheme="gz" />
|
||||
<!--
|
||||
<extension-map extension="tgz" scheme="tgz"/> <extension-map
|
||||
extension="tbz2" scheme="tbz2"/>
|
||||
-->
|
||||
<extension-map extension="tgz" scheme="tar" />
|
||||
<extension-map extension="tbz2" scheme="tar" />
|
||||
|
||||
<!--
|
||||
<filter-map
|
||||
class-name="org.apache.commons.vfs.content.bzip2.Bzip2Compress">
|
||||
<extension name="bz2"/> <extension name="tbz2"/> <if-available
|
||||
class-name="org.apache.commons.compress.bzip2.CBZip2InputStream"/>
|
||||
</filter-map> <filter-map
|
||||
class-name="org.apache.commons.vfs.content.gzip.GzipCompress">
|
||||
<extension name="gz"/> <extension name="tgz"/> <mime-type
|
||||
name="application/x-tgz" /> </filter-map>
|
||||
-->
|
||||
</providers>
|
|
@ -40,6 +40,9 @@ import org.jclouds.logging.log4j.config.Log4JLoggingModule;
|
|||
import org.jclouds.vfs.provider.blobstore.BlobStoreFileObject;
|
||||
import org.jclouds.vfs.provider.blobstore.BlobStoreFileProvider;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.inject.Module;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
|
@ -54,7 +57,8 @@ public class BlobStoreProviderTestCase extends AbstractProviderTestConfig {
|
|||
* Prepares the file system manager.
|
||||
*/
|
||||
public void prepare(final DefaultFileSystemManager manager) throws Exception {
|
||||
manager.addProvider("blobstore", new BlobStoreFileProvider(new Log4JLoggingModule()));
|
||||
manager.addProvider("blobstore", new BlobStoreFileProvider(ImmutableList
|
||||
.<Module>of(new Log4JLoggingModule())));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue