本文整理汇总了Java中org.apache.commons.vfs2.provider.AbstractFileName类的典型用法代码示例。如果您正苦于以下问题:Java AbstractFileName类的具体用法?Java AbstractFileName怎么用?Java AbstractFileName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractFileName类属于org.apache.commons.vfs2.provider包,在下文中一共展示了AbstractFileName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ZipFileSystem
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
public ZipFileSystem(final AbstractFileName rootName,
final FileObject parentLayer,
final FileSystemOptions fileSystemOptions)
throws FileSystemException
{
super(rootName, parentLayer, fileSystemOptions);
// Make a local copy of the file
file = parentLayer.getFileSystem().replicateFile(parentLayer, Selectors.SELECT_SELF);
// Open the Zip file
if (!file.exists())
{
// Don't need to do anything
zipFile = null;
return;
}
// zipFile = createZipFile(this.file);
}
示例2: JarFileObject
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
protected JarFileObject(final AbstractFileName name,
final ZipEntry entry,
final JarFileSystem fs,
final boolean zipExists) throws FileSystemException
{
super(name, entry, fs, zipExists);
this.fs = fs;
try
{
getAttributes(); // early get the attributes as the zip file might be closed
}
catch (IOException e)
{
throw new FileSystemException(e);
}
}
示例3: FtpFileObject
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
protected FtpFileObject(final AbstractFileName name,
final FtpFileSystem fileSystem,
final FileName rootName)
throws FileSystemException
{
super(name, fileSystem);
ftpFs = fileSystem;
String relPath = UriParser.decode(rootName.getRelativeName(name));
if (".".equals(relPath))
{
// do not use the "." as path against the ftp-server
// e.g. the uu.net ftp-server do a recursive listing then
// this.relPath = UriParser.decode(rootName.getPath());
// this.relPath = ".";
this.relPath = null;
}
else
{
this.relPath = relPath;
}
}
示例4: TarFileSystem
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
protected TarFileSystem(final AbstractFileName rootName,
final FileObject parentLayer,
final FileSystemOptions fileSystemOptions)
throws FileSystemException
{
super(rootName, parentLayer, fileSystemOptions);
// Make a local copy of the file
file = parentLayer.getFileSystem().replicateFile(parentLayer, Selectors.SELECT_SELF);
// Open the Tar file
if (!file.exists())
{
// Don't need to do anything
tarFile = null;
return;
}
// tarFile = createTarFile(this.file);
}
示例5: createFile
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
/**
* Creates a file object. This method is called only if the requested
* file is not cached.
*/
@Override
protected FileObject createFile(final AbstractFileName name) throws Exception
{
// Find the file that the name points to
final FileName junctionPoint = getJunctionForFile(name);
final FileObject file;
if (junctionPoint != null)
{
// Resolve the real file
final FileObject junctionFile = junctions.get(junctionPoint);
final String relName = junctionPoint.getRelativeName(name);
file = junctionFile.resolveFile(relName, NameScope.DESCENDENT_OR_SELF);
}
else
{
file = null;
}
// Return a wrapper around the file
return new DelegateFileObject(name, this, file);
}
示例6: createFile
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
/**
* Creates a file object.
*/
protected FileObject createFile(final AbstractFileName name) throws FileSystemException {
if(!exists) {
return new NonExistentJarFileObject(name, this);
} else {
String entryName = getRootName().getRelativeName(name);
if(entryName.equals(".")) {
return new FastJarRootFileObject(name, this);
}
JarEntry entry = getJarFile().getJarEntry(entryName + "/");
if(entry != null) {
return new FastJarFileObject(name, entry, this);
}
entry = getJarFile().getJarEntry(entryName);
if(entry == null) {
return new NonExistentJarFileObject(name, this);
} else {
return new FastJarFileObject(name, entry, this);
}
}
}
示例7: GsiFtpFileObject
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
/**
* Instantiates a new gsi ftp file object.
*
* @param name the name
* @param fileSystem the file system
* @param rootName the root name
*
* @throws FileSystemException the file system exception
*/
protected GsiFtpFileObject(final AbstractFileName name, final GsiFtpFileSystem fileSystem, final FileName rootName) throws FileSystemException {
super(name, fileSystem);
ftpFs = fileSystem;
String relPathTmp = UriParser.decode(rootName.getRelativeName(name));
// log.debug("FileName=" + name + " Root=" + rootName
// + " Relative path=" + relPath );
if (".".equals(relPathTmp)) {
// do not use the "." as path against the ftp-server
// e.g. the uu.net ftp-server do a recursive listing then
// this.relPath = UriParser.decode(rootName.getPath());
// this.relPath = ".";
// boolean ok = true;
// try {
// cwd = ftpFs.getClient().getCurrentDir();
// }
// catch (ServerException se) { ok = false;}
// catch (IOException se) { ok = false;}
// if ( ! ok ) {
// throw new FileSystemException("vfs.provider.gsiftp/get-type.error", getName());
// }
this.relPath = "/"; // cwd;
} else {
this.relPath = relPathTmp;
}
}
示例8: AzFileObject
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
/**
* Creates a new FileObject for use with a remote Azure Blob Storage file or folder.
*
* @param name
* @param fileSystem
*/
protected AzFileObject(final AbstractFileName name, final AzFileSystem fileSystem)
{
super(name, fileSystem);
this.fileSystem = fileSystem;
currContainer = null;
currBlob = null;
currBlobProperties = null;
currContainerProperties = null;
}
示例9: MimeFileObject
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
protected MimeFileObject(final AbstractFileName name,
final Part part,
final AbstractFileSystem fileSystem) throws FileSystemException
{
super(name, fileSystem);
setPart(part);
}
示例10: createFile
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
/**
* Creates a file object.
*/
@Override
protected FileObject createFile(final AbstractFileName name) throws FileSystemException
{
// This is only called for files which do not exist in the Zip file
return new ZipFileObject(name, null, this, false);
}
示例11: ZipFileObject
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
protected ZipFileObject(AbstractFileName name,
ZipEntry entry,
ZipFileSystem fs,
boolean zipExists) throws FileSystemException
{
super(name, fs);
this.fs = fs;
setZipEntry(entry);
if (!zipExists)
{
type = FileType.IMAGINARY;
}
}
示例12: doCreateFileSystem
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
/**
* Creates a layered file system. This method is called if the file system
* is not cached.
*
* @param scheme The URI scheme.
* @param file The file to create the file system on top of.
* @return The file system.
*/
@Override
protected FileSystem doCreateFileSystem(final String scheme,
final FileObject file,
final FileSystemOptions fileSystemOptions)
throws FileSystemException
{
final AbstractFileName rootName =
new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH, FileType.FOLDER);
return new ZipFileSystem(rootName, file, fileSystemOptions);
}
示例13: doCreateFileSystem
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
/**
* Creates a layered file system. This method is called if the file system
* is not cached.
*
* @param scheme The URI scheme.
* @param file The file to create the file system on top of.
* @return The file system.
*/
@Override
protected FileSystem doCreateFileSystem(final String scheme,
final FileObject file,
final FileSystemOptions fileSystemOptions)
throws FileSystemException
{
final AbstractFileName name =
new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH, FileType.FOLDER);
return new JarFileSystem(name, file, fileSystemOptions);
}
示例14: createFile
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
/**
* Creates a file object.
*/
@Override
protected FileObject createFile(final AbstractFileName name) throws FileSystemException
{
// Create the file
return new LocalFile(this, rootFile, name);
}
示例15: LocalFile
import org.apache.commons.vfs2.provider.AbstractFileName; //导入依赖的package包/类
/**
* Creates a non-root file.
*/
protected LocalFile(final LocalFileSystem fileSystem,
final String rootFile,
final AbstractFileName name) throws FileSystemException
{
super(name, fileSystem);
this.rootFile = rootFile;
}