本文整理汇总了Java中org.codehaus.plexus.archiver.zip.ZipUnArchiver类的典型用法代码示例。如果您正苦于以下问题:Java ZipUnArchiver类的具体用法?Java ZipUnArchiver怎么用?Java ZipUnArchiver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ZipUnArchiver类属于org.codehaus.plexus.archiver.zip包,在下文中一共展示了ZipUnArchiver类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: extractApklib
import org.codehaus.plexus.archiver.zip.ZipUnArchiver; //导入依赖的package包/类
public void extractApklib( Artifact apklibArtifact ) throws MojoExecutionException
{
final File apkLibFile = artifactResolverHelper.resolveArtifactToFile( apklibArtifact );
if ( apkLibFile.isDirectory() )
{
log.warn(
"The apklib artifact points to '" + apkLibFile + "' which is a directory; skipping unpacking it." );
return;
}
final UnArchiver unArchiver = new ZipUnArchiver ( apkLibFile )
{
@Override
protected Logger getLogger()
{
return new ConsoleLogger( log.getThreshold(), "dependencies-unarchiver" );
}
};
final File apklibDirectory = getUnpackedLibFolder( apklibArtifact );
apklibDirectory.mkdirs();
unArchiver.setDestDirectory( apklibDirectory );
log.debug( "Extracting APKLIB to " + apklibDirectory );
try
{
unArchiver.extract();
}
catch ( ArchiverException e )
{
throw new MojoExecutionException ( "ArchiverException while extracting " + apklibDirectory
+ ". Message: " + e.getLocalizedMessage(), e );
}
}
开发者ID:simpligility,项目名称:android-ndk-maven-plugin,代码行数:34,代码来源:UnpackedLibHelper.java
示例2: extractJar
import org.codehaus.plexus.archiver.zip.ZipUnArchiver; //导入依赖的package包/类
/**
* @param jarFile Jar file to be extracted
* @param destinationFolder Folder which the jarFile will be extracted to. Jar file's root will be this folder once
* it is extracted.
*/
public static void extractJar( File jarFile, String destinationFolder ) throws MojoExecutionException {
try {
ZipUnArchiver unArchiver = new ZipUnArchiver( jarFile );
unArchiver.enableLogging( new ConsoleLogger( org.codehaus.plexus.logging.Logger.LEVEL_INFO, "console" ) );
unArchiver.setDestDirectory( new File( destinationFolder ) );
unArchiver.extract();
}
catch ( Exception e ) {
throw new MojoExecutionException( "Error while extracting JAR file", e );
}
}
开发者ID:apache,项目名称:usergrid,代码行数:17,代码来源:Utils.java
示例3: unzip
import org.codehaus.plexus.archiver.zip.ZipUnArchiver; //导入依赖的package包/类
private static void unzip(final AbstractWisdomMojo mojo, File in, File out) {
ZipUnArchiver unarchiver = new ZipUnArchiver(in);
unarchiver.enableLogging(new PlexusLoggerWrapper(mojo.getLog()));
unarchiver.setDestDirectory(out);
unarchiver.extract();
}
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:7,代码来源:WisdomRuntimeExpander.java
注:本文中的org.codehaus.plexus.archiver.zip.ZipUnArchiver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论