org.jboss.vfs.VFS.mountZipExpanded()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.jboss.vfs.VFS.mountZipExpanded()方法的一些代码示例,展示了VFS.mountZipExpanded()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VFS.mountZipExpanded()方法的具体详情如下:
包路径:org.jboss.vfs.VFS
类名称:VFS
方法名:mountZipExpanded

VFS.mountZipExpanded介绍

[英]Create and mount an expanded zip file in a temporary file system, returning a single handle which will unmount and close the filesystem when closed.
[中]在临时文件系统中创建并装载一个扩展的zip文件,并返回一个句柄,该句柄将在文件系统关闭时卸载并关闭文件系统。

代码示例

代码示例来源:origin: wildfly/wildfly

private static Closeable mount(VirtualFile moduleFile, boolean explode) throws IOException {
  return explode ? VFS.mountZipExpanded(moduleFile, moduleFile, TempFileProviderService.provider())
      : VFS.mountZip(moduleFile, moduleFile, TempFileProviderService.provider());
}

代码示例来源:origin: org.wildfly.core/wildfly-cli

static MountHandle extractArchive(File archive,
    TempFileProvider tempFileProvider, String name) throws IOException {
  return ((MountHandle) VFS.mountZipExpanded(archive, VFS.getChild(name),
      tempFileProvider));
}

代码示例来源:origin: wildfly/wildfly-core

static MountHandle extractArchive(File archive,
    TempFileProvider tempFileProvider, String name) throws IOException {
  return ((MountHandle) VFS.mountZipExpanded(archive, VFS.getChild(name),
      tempFileProvider));
}

代码示例来源:origin: org.wildfly.core/wildfly-cli

protected MountHandle extractArchive(File archive, TempFileProvider tempFileProvider) throws IOException {
  return ((MountHandle)VFS.mountZipExpanded(archive, VFS.getChild("cli"), tempFileProvider));
}

代码示例来源:origin: wildfly/wildfly-core

protected MountHandle extractArchive(File archive, TempFileProvider tempFileProvider) throws IOException {
  return ((MountHandle)VFS.mountZipExpanded(archive, VFS.getChild("cli"), tempFileProvider));
}

代码示例来源:origin: org.wildfly.core/wildfly-server

public void remountAsZip(boolean expanded) throws IOException {
  IoUtils.safeClose(closeable);
  if(expanded) {
    closeable = VFS.mountZipExpanded(realFile, mountPoint, tempFileProvider);
  } else {
    closeable = VFS.mountZip(realFile, mountPoint, tempFileProvider);
  }
}

代码示例来源:origin: org.wildfly/wildfly-server

public void remountAsZip(boolean expanded) throws IOException {
  IoUtils.safeClose(closeable);
  if(expanded) {
    closeable = VFS.mountZipExpanded(realFile, mountPoint, tempFileProvider);
  } else {
    closeable = VFS.mountZip(realFile, mountPoint, tempFileProvider);
  }
}

代码示例来源:origin: org.jboss/jboss-vfs

/**
 * Create and mount an expanded zip file in a temporary file system, returning a single handle which will unmount and
 * close the filesystem when closed.  The given zip data stream is closed.
 *
 * @param zipFile          a zip file in the VFS
 * @param mountPoint       the point at which the filesystem should be mounted
 * @param tempFileProvider the temporary file provider
 * @return a handle
 * @throws IOException if an error occurs
 */
public static Closeable mountZipExpanded(VirtualFile zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
  return mountZipExpanded(zipFile.openStream(), zipFile.getName(), mountPoint, tempFileProvider);
}

代码示例来源:origin: wildfly/wildfly-core

public void remountAsZip(boolean expanded) throws IOException {
  IoUtils.safeClose(closeable);
  if(expanded) {
    closeable = VFS.mountZipExpanded(realFile, mountPoint, tempFileProvider);
  } else {
    closeable = VFS.mountZip(realFile, mountPoint, tempFileProvider);
  }
}

代码示例来源:origin: org.jboss/jboss-vfs

private void mount(VirtualFile target, MountConfig mountConfig) throws IOException {
  if (mounted.compareAndSet(false, true)) {
    if (target.isFile()) {
      VFSLogger.ROOT_LOGGER.debugf("Automounting: %s with options %s", target, mountConfig);
      final TempFileProvider provider = getTempFileProvider();
      if (mountConfig.mountExpanded()) {
        if (mountConfig.copyTarget()) { handles.add(VFS.mountZipExpanded(target, target, provider)); } else {
          handles.add(VFS.mountZipExpanded(target.getPhysicalFile(), target, provider));
        }
      } else {
        if (mountConfig.copyTarget()) { handles.add(VFS.mountZip(target, target, provider)); } else {
          handles.add(VFS.mountZip(target.getPhysicalFile(), target, provider));
        }
      }
    }
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-ee

private static Closeable mount(VirtualFile moduleFile, boolean explode) throws IOException {
  return explode ? VFS.mountZipExpanded(moduleFile, moduleFile, TempFileProviderService.provider())
      : VFS.mountZip(moduleFile, moduleFile, TempFileProviderService.provider());
}

代码示例来源:origin: org.wildfly/wildfly-ee

private static Closeable mount(VirtualFile moduleFile, boolean explode) throws IOException {
  return explode ? VFS.mountZipExpanded(moduleFile, moduleFile, TempFileProviderService.provider())
      : VFS.mountZip(moduleFile, moduleFile, TempFileProviderService.provider());
}

代码示例来源:origin: org.projectodd/polyglot-core

private static Closeable mount(VirtualFile moduleFile, boolean explode) throws IOException {
  return explode ? VFS.mountZipExpanded( moduleFile, moduleFile, TempFileProviderService.provider() )
          : VFS.mountZip( moduleFile, moduleFile, TempFileProviderService.provider() );
}

代码示例来源:origin: org.jboss.eap/wildfly-ee

private static Closeable mount(VirtualFile moduleFile, boolean explode) throws IOException {
  return explode ? VFS.mountZipExpanded(moduleFile, moduleFile, TempFileProviderService.provider())
      : VFS.mountZip(moduleFile, moduleFile, TempFileProviderService.provider());
}

代码示例来源:origin: org.jboss.as/jboss-as-appclient

private static Closeable mount(VirtualFile moduleFile, boolean explode) throws DeploymentUnitProcessingException {
  try {
    return explode ? VFS.mountZipExpanded(moduleFile, moduleFile, TempFileProviderService.provider())
        : VFS.mountZip(moduleFile, moduleFile, TempFileProviderService.provider());
  } catch (IOException e) {
    throw new DeploymentUnitProcessingException(e);
  }
}

代码示例来源:origin: org.wildfly.swarm/wildfly-swarm-container-runtime

Closeable closeable = VFS.mountZipExpanded(in, deployment.getName(), mountPoint, tempFileProvider);
this.mountPoints.add(closeable);

代码示例来源:origin: wildfly/wildfly-core

@Override
public Closeable mountDeploymentContent(final VirtualFile contents, VirtualFile mountPoint, MountType type) throws IOException {
  // according to the javadoc contents can not be null
  assert contents != null : "null contents";
  switch (type) {
    case ZIP:
      return VFS.mountZip(contents, mountPoint, tempFileProvider);
    case EXPANDED:
      return VFS.mountZipExpanded(contents, mountPoint, tempFileProvider);
    case REAL:
      return VFS.mountReal(contents.getPhysicalFile(), mountPoint);
    default:
      throw ServerLogger.ROOT_LOGGER.unknownMountType(type);
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-server

@Override
public Closeable mountDeploymentContent(final VirtualFile contents, VirtualFile mountPoint, MountType type) throws IOException {
  // according to the javadoc contents can not be null
  assert contents != null : "null contents";
  switch (type) {
    case ZIP:
      return VFS.mountZip(contents, mountPoint, tempFileProvider);
    case EXPANDED:
      return VFS.mountZipExpanded(contents, mountPoint, tempFileProvider);
    case REAL:
      return VFS.mountReal(contents.getPhysicalFile(), mountPoint);
    default:
      throw ServerMessages.MESSAGES.unknownMountType(type);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-server

@Override
public Closeable mountDeploymentContent(final VirtualFile contents, VirtualFile mountPoint, MountType type) throws IOException {
  // according to the javadoc contents can not be null
  assert contents != null : "null contents";
  switch (type) {
    case ZIP:
      return VFS.mountZip(contents, mountPoint, tempFileProvider);
    case EXPANDED:
      return VFS.mountZipExpanded(contents, mountPoint, tempFileProvider);
    case REAL:
      return VFS.mountReal(contents.getPhysicalFile(), mountPoint);
    default:
      throw ServerLogger.ROOT_LOGGER.unknownMountType(type);
  }
}

代码示例来源:origin: org.wildfly/wildfly-server

@Override
public Closeable mountDeploymentContent(final VirtualFile contents, VirtualFile mountPoint, MountType type) throws IOException {
  // according to the javadoc contents can not be null
  assert contents != null : "null contents";
  switch (type) {
    case ZIP:
      return VFS.mountZip(contents, mountPoint, tempFileProvider);
    case EXPANDED:
      return VFS.mountZipExpanded(contents, mountPoint, tempFileProvider);
    case REAL:
      return VFS.mountReal(contents.getPhysicalFile(), mountPoint);
    default:
      throw ServerMessages.MESSAGES.unknownMountType(type);
  }
}

相关文章