当前位置: 首页>>代码示例>>Java>>正文


Java ProviderMismatchException类代码示例

本文整理汇总了Java中java.nio.file.ProviderMismatchException的典型用法代码示例。如果您正苦于以下问题:Java ProviderMismatchException类的具体用法?Java ProviderMismatchException怎么用?Java ProviderMismatchException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ProviderMismatchException类属于java.nio.file包,在下文中一共展示了ProviderMismatchException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: move

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
@Override
public void move(Path srcPath, SecureDirectoryStream<Path> targetDir, Path targetPath)
    throws IOException {
  checkOpen();
  JimfsPath checkedSrcPath = checkPath(srcPath);
  JimfsPath checkedTargetPath = checkPath(targetPath);

  if (!(targetDir instanceof JimfsSecureDirectoryStream)) {
    throw new ProviderMismatchException(
        "targetDir isn't a secure directory stream associated with this file system");
  }

  JimfsSecureDirectoryStream checkedTargetDir = (JimfsSecureDirectoryStream) targetDir;

  view.copy(
      checkedSrcPath,
      checkedTargetDir.view,
      checkedTargetPath,
      ImmutableSet.<CopyOption>of(),
      true);
}
 
开发者ID:google,项目名称:jimfs,代码行数:22,代码来源:JimfsSecureDirectoryStream.java

示例2: resolve

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
@Override
public JimfsPath resolve(Path other) {
  JimfsPath otherPath = checkPath(other);
  if (otherPath == null) {
    throw new ProviderMismatchException(other.toString());
  }

  if (isEmptyPath() || otherPath.isAbsolute()) {
    return otherPath;
  }
  if (otherPath.isEmptyPath()) {
    return this;
  }
  return pathService.createPath(
      root,
      ImmutableList.<Name>builder()
          .addAll(names)
          .addAll(otherPath.names)
          .build());
}
 
开发者ID:google,项目名称:jimfs,代码行数:21,代码来源:JimfsPath.java

示例3: resolveSibling

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
@Override
public JimfsPath resolveSibling(Path other) {
  JimfsPath otherPath = checkPath(other);
  if (otherPath == null) {
    throw new ProviderMismatchException(other.toString());
  }

  if (otherPath.isAbsolute()) {
    return otherPath;
  }
  JimfsPath parent = getParent();
  if (parent == null) {
    return otherPath;
  }
  return parent.resolve(other);
}
 
开发者ID:google,项目名称:jimfs,代码行数:17,代码来源:JimfsPath.java

示例4: toCachePath

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
@Override
protected LocalPath toCachePath( Path path )
{
    Objects.requireNonNull( path );
    if( !(path instanceof LocalPath) ) {
        throw new ProviderMismatchException();
    }
    return (LocalPath) path.toAbsolutePath();
}
 
开发者ID:peter-mount,项目名称:filesystem,代码行数:10,代码来源:LocalFileSystemProvider.java

示例5: checkPath

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
private P checkPath( Path path )
{
    if( path == null ) {
        throw new NullPointerException();
    }
    if( !(path instanceof AbstractPath) ) {
        throw new ProviderMismatchException();
    }
    return (P) path;
}
 
开发者ID:peter-mount,项目名称:filesystem,代码行数:11,代码来源:AbstractPath.java

示例6: toCachePath

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
@Override
protected CachePath toCachePath( Path path )
{
    Objects.requireNonNull( path );
    if( !(path instanceof CachePath) ) {
        throw new ProviderMismatchException();
    }
    return (CachePath) path.toAbsolutePath();
}
 
开发者ID:peter-mount,项目名称:filesystem,代码行数:10,代码来源:CacheFileSystemProvider.java

示例7: toPath

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
protected MemoryPath toPath( Path path )
{
    Objects.requireNonNull( path );
    if( !(path instanceof MemoryPath) ) {
        throw new ProviderMismatchException();
    }
    return (MemoryPath) path.toAbsolutePath();
}
 
开发者ID:peter-mount,项目名称:filesystem,代码行数:9,代码来源:MemoryFileSystemProvider.java

示例8: toMCRPath

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
public static MCRPath toMCRPath(final Path other) {
    if (other == null) {
        throw new NullPointerException();
    }
    if (!(other instanceof MCRPath)) {
        throw new ProviderMismatchException("other is not an instance of MCRPath: " + other.getClass());
    }
    return (MCRPath) other;
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:10,代码来源:MCRPath.java

示例9: checkPathAbsolute

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
static MCRPath checkPathAbsolute(Path path) {
    MCRPath mcrPath = MCRPath.toMCRPath(path);
    if (!(Objects.requireNonNull(mcrPath.getFileSystem(), "'path' requires a associated filesystem.")
        .provider() instanceof MCRFileSystemProvider)) {
        throw new ProviderMismatchException("Path does not match to this provider: " + path);
    }
    if (!mcrPath.isAbsolute()) {
        throw new InvalidPathException(mcrPath.toString(), "'path' must be absolute.");
    }
    return mcrPath;
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:12,代码来源:MCRFileSystemUtils.java

示例10: register

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
@Override
public WatchKey register(WatchService watcher,
  WatchEvent.Kind<?>[] events,
  WatchEvent.Modifier... modifiers)
    throws IOException {
  if (watcher == null) {
    throw new NullPointerException();
  }
  if (!(watcher instanceof AbstractWatchService)) {
    throw new ProviderMismatchException();
  }
  return ((AbstractWatchService) watcher).register(this, Arrays.asList(events));
}
 
开发者ID:takari,项目名称:directory-watcher,代码行数:14,代码来源:WatchablePath.java

示例11: getFile

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
@Nonnull
public static String getFile(URI uri) throws ProviderMismatchException {
  checkScheme(uri);
  String fragment = uri.getFragment();
  if(fragment == null)
    fragment = "";
  if(!fragment.startsWith("/"))
    fragment = "/" + fragment;
  if(fragment.length() > 1 && fragment.endsWith("/"))
    fragment = fragment.substring(0, fragment.length() - 1);
  return fragment;
}
 
开发者ID:beijunyi,项目名称:ParallelGit,代码行数:13,代码来源:GfsUriUtils.java

示例12: dismantle

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
static Path dismantle(Path mantle) {
	if (mantle == null)
		throw new NullPointerException();
	if (!(mantle instanceof EncryptedFileSystemPath))
		throw new ProviderMismatchException();
	return ((EncryptedFileSystemPath) mantle).subFSPath;
}
 
开发者ID:usrflo,项目名称:encfs4j,代码行数:8,代码来源:EncryptedFileSystem.java

示例13: register

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
@Override
public WatchKey register(WatchService watcher,
                         WatchEvent.Kind<?>[] events,
                         WatchEvent.Modifier... modifiers)
        throws IOException {
    if (watcher == null)
        throw new NullPointerException();
    if (!(watcher instanceof AbstractWatchService))
        throw new ProviderMismatchException();
    return ((AbstractWatchService) watcher).register(this, events, modifiers);
}
 
开发者ID:ReactiveX,项目名称:RxJavaFileUtils,代码行数:12,代码来源:WatchableFile.java

示例14: toEfsPath

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
private EphemeralFsPath toEfsPath(Path other) {
    if(other == null) {
        throw new NullPointerException();
    }
    try
    {
        return (EphemeralFsPath) other;
    } catch(ClassCastException e) {
        throw new ProviderMismatchException();
    }
}
 
开发者ID:sbridges,项目名称:ephemeralfs,代码行数:12,代码来源:EphemeralFsPath.java

示例15: toTarPath

import java.nio.file.ProviderMismatchException; //导入依赖的package包/类
static final TarPath toTarPath(Path path) {
	if (path == null) {
		throw new NullPointerException();
	}
	if (!(path instanceof TarPath)) {
		throw new ProviderMismatchException();
	}
	return (TarPath) path;
}
 
开发者ID:PeterLaker,项目名称:archive-fs,代码行数:10,代码来源:AbstractTarFileSystemProvider.java


注:本文中的java.nio.file.ProviderMismatchException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。