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


Java Message.warn方法代码示例

本文整理汇总了Java中org.apache.ivy.util.Message.warn方法的典型用法代码示例。如果您正苦于以下问题:Java Message.warn方法的具体用法?Java Message.warn怎么用?Java Message.warn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ivy.util.Message的用法示例。


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

示例1: checkStatusCode

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
private boolean checkStatusCode(URL url, HttpURLConnection con) throws IOException {
    final int status = con.getResponseCode();
    if (status == HttpStatus.SC_OK) {
        return true;
    }

    // IVY-1328: some servers return a 204 on a HEAD request
    if ("HEAD".equals(con.getRequestMethod()) && (status == 204)) {
        return true;
    }

    Message.debug("HTTP response status: " + status + " url=" + url);
    if (status == HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED) {
        Message.warn("Your proxy requires authentication.");
    } else if (String.valueOf(status).startsWith("4")) {
        Message.verbose("CLIENT ERROR: " + con.getResponseMessage() + " url=" + url);
    } else if (String.valueOf(status).startsWith("5")) {
        Message.error("SERVER ERROR: " + con.getResponseMessage() + " url=" + url);
    }
    return false;
}
 
开发者ID:jerkar,项目名称:jerkar,代码行数:22,代码来源:IvyFollowRedirectUrlHandler.java

示例2: onMissingDescriptor

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
private void onMissingDescriptor(File buildFile, File ivyFile, List<File> noDescriptor) {
    switch (onMissingDescriptor) {
        case OnMissingDescriptor.FAIL:
            throw new BuildException("a module has no module descriptor and"
                    + " onMissingDescriptor=fail. Build file: " + buildFile
                    + ". Expected descriptor: " + ivyFile);
        case OnMissingDescriptor.SKIP:
            Message.debug("skipping " + buildFile + ": descriptor " + ivyFile
                    + " doesn't exist");
            break;
        case OnMissingDescriptor.WARN:
            Message.warn("a module has no module descriptor. " + "Build file: " + buildFile
                    + ". Expected descriptor: " + ivyFile);
            // fall through
        default:
            Message.verbose(String.format("no descriptor for %s: descriptor=%s: adding it at the %s of the path",
                    buildFile, ivyFile, (OnMissingDescriptor.TAIL.equals(onMissingDescriptor) ? "tail" : "head")));
            Message.verbose("\t(change onMissingDescriptor if you want to take another action");
            noDescriptor.add(buildFile);
            break;
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:23,代码来源:IvyBuildList.java

示例3: getDependencyManagementMap

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
public static Map<ModuleId, String> getDependencyManagementMap(ModuleDescriptor md) {
    Map<ModuleId, String> ret = new LinkedHashMap<>();
    if (md instanceof PomModuleDescriptor) {
        for (Map.Entry<ModuleId, PomDependencyMgt> e : ((PomModuleDescriptor) md)
                .getDependencyManagementMap().entrySet()) {
            PomDependencyMgt dependencyMgt = e.getValue();
            ret.put(e.getKey(), dependencyMgt.getVersion());
        }
    } else {
        for (ExtraInfoHolder extraInfoHolder : md.getExtraInfos()) {
            String key = extraInfoHolder.getName();
            if (key.startsWith(DEPENDENCY_MANAGEMENT)) {
                String[] parts = key.split(EXTRA_INFO_DELIMITER);
                if (parts.length != DEPENDENCY_MANAGEMENT_KEY_PARTS_COUNT) {
                    Message.warn("what seem to be a dependency management extra info "
                            + "doesn't match expected pattern: " + key);
                } else {
                    ret.put(ModuleId.newInstance(parts[1], parts[2]),
                        extraInfoHolder.getContent());
                }
            }
        }
    }
    return ret;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:26,代码来源:PomModuleDescriptorBuilder.java

示例4: getRMDParser

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
protected ResourceMDParser getRMDParser(final DependencyDescriptor dd, final ResolveData data) {
    return new ResourceMDParser() {
        public MDResolvedResource parse(Resource resource, String rev) {
            try {
                ResolvedModuleRevision rmr = BasicResolver.this.parse(new ResolvedResource(
                        resource, rev), dd, data);
                if (rmr != null) {
                    return new MDResolvedResource(resource, rev, rmr);
                }
            } catch (ParseException e) {
                Message.warn("Failed to parse the file '" + resource + "'", e);
            }
            return null;
        }

    };
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:18,代码来源:BasicResolver.java

示例5: getExtraClasspathFileList

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
 * Parses the <code>cp</code> option from the command line, and returns a list of {@link File}.
 * <p>
 * All the files contained in the returned List exist, non existing files are simply skipped
 * with a warning.
 * </p>
 *
 * @param line
 *            the command line in which the cp option should be parsed
 * @return a List of files to include as extra classpath entries, or <code>null</code> if no cp
 *         option was provided.
 */
private static List<File> getExtraClasspathFileList(CommandLine line) {
    List<File> fileList = null;
    if (line.hasOption("cp")) {
        fileList = new ArrayList<>();
        for (String cp : line.getOptionValues("cp")) {
            StringTokenizer tokenizer = new StringTokenizer(cp, File.pathSeparator);
            while (tokenizer.hasMoreTokens()) {
                String token = tokenizer.nextToken();
                File file = new File(token);
                if (file.exists()) {
                    fileList.add(file);
                } else {
                    Message.warn("Skipping extra classpath '" + file
                            + "' as it does not exist.");
                }
            }
        }
    }
    return fileList;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:33,代码来源:Main.java

示例6: listAll

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
public static String[] listAll(URLLister lister, URL root) {
    try {
        if (lister.accept(root.toExternalForm())) {
            Message.debug("\tusing " + lister + " to list all in " + root);
            List<URL> all = lister.listAll(root);
            Message.debug("\t\tfound " + all.size() + " urls");
            List<String> names = new ArrayList<>(all.size());
            for (URL dir : all) {
                String path = dir.getPath();
                if (path.endsWith("/")) {
                    path = path.substring(0, path.length() - 1);
                }
                int slashIndex = path.lastIndexOf('/');
                names.add(path.substring(slashIndex + 1));
            }
            return names.toArray(new String[names.size()]);
        }
        return null;
    } catch (Exception e) {
        Message.warn("problem while listing directories in " + root, e);
        return null;
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:24,代码来源:ResolverHelper.java

示例7: checkStatusCode

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
private boolean checkStatusCode(URL url, HttpURLConnection con) throws IOException {
    int status = con.getResponseCode();
    if (status == HttpStatus.SC_OK) {
        return true;
    }

    // IVY-1328: some servers return a 204 on a HEAD request
    if ("HEAD".equals(con.getRequestMethod()) && (status == 204)) {
        return true;
    }

    Message.debug("HTTP response status: " + status + " url=" + url);
    if (status == HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED) {
        Message.warn("Your proxy requires authentication.");
    } else if (String.valueOf(status).startsWith("4")) {
        Message.verbose("CLIENT ERROR: " + con.getResponseMessage() + " url=" + url);
    } else if (String.valueOf(status).startsWith("5")) {
        Message.error("SERVER ERROR: " + con.getResponseMessage() + " url=" + url);
    }
    return false;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:22,代码来源:BasicURLHandler.java

示例8: discardConf

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@Deprecated
public void discardConf(String rootModuleConf, String conf) {
    Set<String> depConfs = usage.addAndGetConfigurations(rootModuleConf);
    if (md == null) {
        depConfs.remove(conf);
    } else {
        // remove all given dependency configurations to the set + extended ones
        Configuration c = md.getConfiguration(conf);
        if (conf == null) {
            Message.warn("unknown configuration in " + getId() + ": " + conf);
        } else {
            // recursive remove of extended configurations
            for (String ext : c.getExtends()) {
                discardConf(rootModuleConf, ext);
            }
            depConfs.remove(c.getName());
        }
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:20,代码来源:IvyNode.java

示例9: lslToResource

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
 * Parses a ls -l line and transforms it in a resource
 *
 * @param file ditto
 * @param responseLine ditto
 * @return Resource
 */
protected Resource lslToResource(String file, String responseLine) {
    if (responseLine == null || responseLine.startsWith("ls")) {
        return new BasicResource(file, false, 0, 0, false);
    } else {
        String[] parts = responseLine.split("\\s+");
        if (parts.length != LS_PARTS_NUMBER) {
            Message.debug("unrecognized ls format: " + responseLine);
            return new BasicResource(file, false, 0, 0, false);
        } else {
            try {
                long contentLength = Long.parseLong(parts[LS_SIZE_INDEX]);
                String date = parts[LS_DATE_INDEX1] + " " + parts[LS_DATE_INDEX2] + " "
                        + parts[LS_DATE_INDEX3] + " " + parts[LS_DATE_INDEX4];
                return new BasicResource(file, true, contentLength, FORMAT.parse(date)
                        .getTime(), false);
            } catch (Exception ex) {
                Message.warn("impossible to parse server response: " + responseLine, ex);
                return new BasicResource(file, false, 0, 0, false);
            }
        }
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:30,代码来源:VsftpRepository.java

示例10: analyze

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
 * Analyze data in the repository.
 * <p>
 * This method may take a long time to proceed. It should never be called from event dispatch
 * thread in a GUI.
 * </p>
 *
 * @throws IllegalStateException
 *             if the repository has not been loaded yet
 * @see #load()
 */
public void analyze() {
    ensureLoaded();
    Message.info("\nanalyzing dependencies...");
    for (ModuleDescriptor md : revisions.values()) {
        for (DependencyDescriptor dd : md.getDependencies()) {
            ModuleRevisionId dep = getDependency(dd);
            if (dep == null) {
                Message.warn("inconsistent repository: declared dependency not found: " + dd);
            } else {
                getDependers(dep).add(md.getModuleRevisionId());
            }
        }
        Message.progress();
    }
    analyzed = true;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:28,代码来源:RepositoryManagementEngine.java

示例11: SvnRepository

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
 * Initialises repository to accept requests for svn protocol.
 */
public SvnRepository() {
  super();
  FSRepositoryFactory.setup();
  DAVRepositoryFactory.setup();
  SVNRepositoryFactoryImpl.setup();
  try {
    Manifest manifest = getManifest(this.getClass());
    Attributes attributes = manifest.getMainAttributes();
    Message.info("IvySvn Build-Version: " + attributes.getValue("Build-Version"));
    Message.info("IvySvn Build-DateTime: " + attributes.getValue("Build-DateTime"));
  } catch (IOException e) {
    Message.warn("Could not load manifest: " + e.getMessage());
  }
}
 
开发者ID:massdosage,项目名称:ivysvn,代码行数:18,代码来源:SvnRepository.java

示例12: getExportPackage

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
private static ExportPackage getExportPackage(BundleInfo bundleInfo, Capability capability)
        throws ParseException {
    String pkgName = null;
    Version version = null;
    String uses = null;
    for (CapabilityProperty property : capability.getProperties()) {
        String propName = property.getName();
        switch (propName) {
            case "package":
                pkgName = property.getValue();
                break;
            case "uses":
                uses = property.getValue();
                break;
            case "version":
                version = new Version(property.getValue());
                break;
            default:
                Message.warn("Unsupported property '" + propName
                        + "' on the 'package' capability of the bundle '"
                        + bundleInfo.getSymbolicName() + "'");
                break;
        }
    }
    if (pkgName == null) {
        throw new ParseException("No package name for the capability", 0);
    }
    ExportPackage exportPackage = new ExportPackage(pkgName, version);
    if (uses != null) {
        for (String use : splitToArray(uses)) {
            exportPackage.addUse(use);
        }
    }
    return exportPackage;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:36,代码来源:CapabilityAdapter.java

示例13: toIvyFile

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md)
        throws ParseException, IOException {
    ModuleDescriptorParser parser = getParser(res);
    if (parser == null) {
        Message.warn("no module descriptor parser found for " + res);
    } else {
        parser.toIvyFile(is, res, destFile, md);
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:10,代码来源:ModuleDescriptorParserRegistry.java

示例14: newSAXParser

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
private static SAXParser newSAXParser(URL schema, InputStream schemaStream,
        boolean loadExternalDtds) throws ParserConfigurationException, SAXException {
    SAXParserFactory parserFactory = SAXParserFactory.newInstance();
    parserFactory.setNamespaceAware(true);
    parserFactory.setValidating(canUseSchemaValidation && (schema != null));
    if (!loadExternalDtds && canDisableExternalDtds(parserFactory)) {
        parserFactory.setFeature(XERCES_LOAD_EXTERNAL_DTD, false);
    }
    SAXParser parser = parserFactory.newSAXParser();

    if (canUseSchemaValidation && (schema != null)) {
        try {
            parser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
            parser.setProperty(JAXP_SCHEMA_SOURCE, schemaStream);
        } catch (SAXNotRecognizedException ex) {
            Message.warn("problem while setting JAXP validating property on SAXParser... "
                    + "XML validation will not be done (" + ex.getClass().getName() + ": "
                    + ex.getMessage() + ")");
            canUseSchemaValidation = false;
            parserFactory.setValidating(false);
            parser = parserFactory.newSAXParser();
        }
    }

    parser.getXMLReader().setFeature(XML_NAMESPACE_PREFIXES, true);
    return parser;
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:28,代码来源:XMLHelper.java

示例15: setKeyFile

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
 * Sets the full file path to use for accessing a PEM key file
 *
 * @param filePath
 *            fully qualified name
 */
public void setKeyFile(File filePath) {
    this.keyFile = filePath;
    if (!keyFile.exists()) {
        Message.warn("Pemfile " + keyFile.getAbsolutePath() + " doesn't exist.");
        keyFile = null;
    } else if (!keyFile.canRead()) {
        Message.warn("Pemfile " + keyFile.getAbsolutePath() + " not readable.");
        keyFile = null;
    } else {
        Message.debug("Using " + keyFile.getAbsolutePath() + " as keyfile.");
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:19,代码来源:AbstractSshBasedRepository.java


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