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

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

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

VFS.mountZip介绍

[英]Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file system 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: wildfly/wildfly

overlay.remountAsZip(false);
} else if (archive.isFile()) {
  closable = VFS.mountZip(archive, archive, TempFileProviderService.provider());
} else {
  closable = null;

代码示例来源: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: wildfly/wildfly

overlay.remountAsZip(false);
} else if(child.isFile()) {
  closable = VFS.mountZip(child, child, TempFileProviderService.provider());

代码示例来源: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: wildfly/wildfly

overlay.remountAsZip(false);
} else if(child.isFile()) {
  closable = VFS.mountZip(child, child, TempFileProviderService.provider());

代码示例来源: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.osgi.vfs/jbosgi-vfs30

private void ensureMounted() throws IOException {
  synchronized (this) {
    if (mount == null && acceptForMount()) {
      mount = VFS.mountZip(vfsFile, vfsFile, tmpProvider);
    }
  }
}

代码示例来源: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.jboss/jboss-vfs

/**
 * Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file
 * system when 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 mountZip(VirtualFile zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
  return mountZip(zipFile.openStream(), zipFile.getName(), mountPoint, tempFileProvider);
}

代码示例来源: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.jboss/jboss-vfs

public void addZip(final String path, final File zipFile) throws IOException {
  VirtualFile mountPoint = mountRoot.getChild(path);
  Closeable handle = VFS.mountZip(zipFile, mountPoint, getTempFileProvider());
  mountHandles.add(handle);
  add(path, mountPoint);
}

代码示例来源: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.ejb3.embedded/jboss-ejb3-embedded-sub

public void addZip(final String path, final File zipFile) throws IOException {
 VirtualFile mountPoint = mountRoot.getChild(path);
 Closeable handle = VFS.mountZip(zipFile, mountPoint, getTempFileProvider());
 mountHandles.add(handle);
 add(path, mountPoint);
}

代码示例来源: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.osgi.vfs/jbosgi-vfs30

VirtualFileAdaptor30(String name, InputStream input) throws IOException {
  this(VFS.getChild(name));
  if (input == null)
    throw MESSAGES.illegalArgumentNull("input");
  mount = VFS.mountZip(input, vfsFile.getName(), vfsFile, tmpProvider);
}

代码示例来源: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: 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.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);
  }
}

代码示例来源: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);
  }
}

相关文章