• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ManifestException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: execute

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
@Override
public void execute() throws BuildException {
    File tmpFile = null;
    try {
        if (isSigned(jar) == null) {
            tmpFile = extendLibraryManifest(getProject(), jar, destJar, codebase, permissions, appName);
        }
    } catch (IOException | ManifestException ex) {
        getProject().log(
                "Failed to extend libraries manifests: " + ex.getMessage(), //NOI18N
                Project.MSG_WARN);
    }
    if (tmpFile != null) {
        sign(tmpFile, destJar);
        deleteTmpFile(tmpFile);
    } else {
        sign(jar, destJar);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:JNLPUpdateManifestStartup.java


示例2: packageConsole

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
private void packageConsole() throws CreatorExecutionException {
    try {
        Jar jarArchiver = new Jar();
        jarArchiver.setProject(new Project());
        jarArchiver.setDestFile(destinationWar);
        final FileSet fileSet = new FileSet();
        fileSet.setDir(workingDirectory);
        jarArchiver.addFileset(fileSet);

        jarArchiver.addConfiguredManifest(createManifest());

        jarArchiver.execute();

    } catch (ManifestException e) {
        throw new CreatorExecutionException(e.getMessage(), e);
    }
}
 
开发者ID:eirbjo,项目名称:jetty-console,代码行数:18,代码来源:DefaultCreator.java


示例3: conditionallyAddAttribute

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
String conditionallyAddAttribute( Manifest.Section section, String key, String value )
{
    Manifest.Attribute attr = section.getAttribute( key );
    if ( attr == null )
    {
        attr = new Manifest.Attribute();
        attr.setName( key );
        attr.setValue( value != null ? value.replaceAll("\\s+", " ").trim() : "<undefined>" );
        try
        {
            section.addConfiguredAttribute( attr );
        }
        catch ( ManifestException ex )
        {
            getLog().error( "Cannot update manifest (key=" + key + ")" );
            ex.printStackTrace();
        }
    }
    return attr.getValue();
}
 
开发者ID:bitstrings,项目名称:nbm-maven,代码行数:21,代码来源:NetBeansManifestUpdateMojo.java


示例4: createManifest

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
void createManifest() {
    this.manifestFile = new File(scratchDir(), "MANIFEST.MF");

    Manifest.Attribute mainClass = new Manifest.Attribute();
    mainClass.setName("Main-Class");
    mainClass.setValue(parent.getMainClass());

    ManifestTask manifest = createTask(ManifestTask.class);
    manifest.setFile(manifestFile);
    try {
        manifest.addConfiguredAttribute(mainClass);
    } catch (ManifestException e) {
        throw new BuildException("Manifest error", e);
    }

    manifest.execute();
}
 
开发者ID:andrus,项目名称:japp-maven-plugin,代码行数:18,代码来源:JAppJavaWorker.java


示例5: execute

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
@Override
public void execute() throws BuildException {
    Set<String> filePaths = new HashSet<>();
    File tmpFile = null;
    for (FileSet fs : filesets) {
        if (fs != null) {
            DirectoryScanner scan = fs.getDirectoryScanner(getProject());
            for (String f : scan.getIncludedFiles()) {
                filePaths.add(fs.getDir().getAbsolutePath() + File.separatorChar + f.replace(File.separatorChar, '/'));
            }
        }
    }
    try {
        for (String filePathIter : filePaths) {
            File jarFile = new File(filePathIter);
            if (isSigned(jarFile) == null) {
                tmpFile = extendLibraryManifest(getProject(), jarFile, jarFile, codebase, permissions, appName);
            }
            if (tmpFile != null) {
                sign(tmpFile, jarFile);
                deleteTmpFile(tmpFile);
            } else {
                sign(jarFile, jarFile);
            }

        }
    } catch (IOException | ManifestException ex) {
        getProject().log(
                "Failed to extend libraries manifests: " + ex.getMessage(), //NOI18N
                Project.MSG_WARN);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:JNLPUpdateManifestBranding.java


示例6: addConfiguredManifest

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
@Override
public void addConfiguredManifest(Manifest newManifest) throws ManifestException {
    super.addConfiguredManifest(newManifest);
    this.mf = newManifest;

    layer = mf.getMainSection().getAttributeValue("OpenIDE-Module-Layer"); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:CslJar.java


示例7: extendLibrariesManifests

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
private static void extendLibrariesManifests(
    final Project prj,
    final File mainJar,
    final List<? extends File> libraries) throws IOException {
    String codebase = null;
    String permissions = null;
    String appName = null;
    final JarFile jf = new JarFile(mainJar);
    try {
        final java.util.jar.Manifest mf = jf.getManifest();
        if (mf != null) {
            final Attributes attrs = mf.getMainAttributes();
            codebase = attrs.getValue(ATTR_CODEBASE);
            permissions = attrs.getValue(ATTR_PERMISSIONS);
            appName = attrs.getValue(ATTR_APPLICATION_NAME);
        }
    } finally {
        jf.close();
    }
    prj.log(
        String.format(
            "Application: %s manifest: Codebase: %s, Permissions: %s, Application-Name: %s",    //NOI18N
            safeRelativePath(prj.getBaseDir(), mainJar),
            codebase,
            permissions,
            appName),
        Project.MSG_VERBOSE);
    if (codebase != null || permissions != null || appName != null) {
        for (File library : libraries) {
            try {
                extendLibraryManifest(prj, library, codebase, permissions, appName);
            } catch (ManifestException mex) {
                throw new IOException(mex);
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:38,代码来源:SignJarsTask.java


示例8: createManifest

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
private Manifest createManifest() throws ManifestException {
    Manifest manifest = new Manifest();
    manifest.addConfiguredAttribute(new Manifest.Attribute("Main-Class", MAIN_CLASS));

    for (Map.Entry<String, String> entry : manifestEntries.entrySet())
        manifest.addConfiguredAttribute(new Manifest.Attribute(entry.getKey(), entry.getValue()));

    return manifest;
}
 
开发者ID:eirbjo,项目名称:jetty-console,代码行数:10,代码来源:DefaultCreator.java


示例9: addAttributesToAnt

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
private void addAttributesToAnt(Manifest antManifest) {
    for (Map.Entry<String, Object> entry : attributes.entrySet()) {
        try {
            antManifest.addConfiguredAttribute(new Attribute(entry.getKey(), entry.getValue().toString()));
        } catch (ManifestException e) {
            throw new org.gradle.api.java.archives.ManifestException(e.getMessage(), e);
        }
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:DefaultManifest.java


示例10: addSectionAttributesToAnt

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
private void addSectionAttributesToAnt(Manifest antManifest) {
    for (Map.Entry<String, Attributes> entry : sections.entrySet()) {
        Section section = new Section();
        section.setName(entry.getKey());
        try {
            antManifest.addConfiguredSection(section);
            for (Map.Entry<String, Object> attributeEntry : entry.getValue().entrySet()) {
                section.addConfiguredAttribute(new Attribute(attributeEntry.getKey(), attributeEntry.getValue().toString()));
            }
        } catch (ManifestException e) {
            throw new org.gradle.api.java.archives.ManifestException(e.getMessage(), e);
        }
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:15,代码来源:DefaultManifest.java


示例11: addAttributesToAnt

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
private void addAttributesToAnt(Manifest antManifest) {
    for (Map.Entry<String, Object> entry : attributes.entrySet()) {
        try {
            antManifest.addConfiguredAttribute(new Attribute(entry.getKey().toString(), entry.getValue().toString()));
        } catch (ManifestException e) {
            throw new org.gradle.api.java.archives.ManifestException(e.getMessage(), e);
        }
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:DefaultManifest.java


示例12: addSectionAttributesToAnt

import org.apache.tools.ant.taskdefs.ManifestException; //导入依赖的package包/类
private void addSectionAttributesToAnt(Manifest antManifest) {
    for (Map.Entry<String, Attributes> entry : sections.entrySet()) {
        Section section = new Section();
        section.setName(entry.getKey());
        try {
            antManifest.addConfiguredSection(section);
            for (Map.Entry<String, Object> attributeEntry : entry.getValue().entrySet()) {
                section.addConfiguredAttribute(new Attribute(attributeEntry.getKey().toString(), attributeEntry.getValue().toString()));
            }
        } catch (ManifestException e) {
            throw new org.gradle.api.java.archives.ManifestException(e.getMessage(), e);
        }
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:15,代码来源:DefaultManifest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TaglibFactory类代码示例发布时间:2022-05-22
下一篇:
Java HttpMethods类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap