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


Java Message.verbose方法代码示例

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


在下文中一共展示了Message.verbose方法的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: output

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
public void output(ConfigurationResolveReport report, String resolveId, String[] confs,
        ResolutionCacheManager cacheMgr) throws IOException {
    File reportFile = cacheMgr.getConfigurationResolveReportInCache(resolveId,
        report.getConfiguration());
    File reportParentDir = reportFile.getParentFile();
    reportParentDir.mkdirs();
    OutputStream stream = new FileOutputStream(reportFile);
    writer.output(report, confs, stream);
    stream.close();

    Message.verbose("\treport for " + report.getModuleDescriptor().getModuleRevisionId() + " "
            + report.getConfiguration() + " produced in " + reportFile);

    File reportXsl = new File(reportParentDir, "ivy-report.xsl");
    File reportCss = new File(reportParentDir, "ivy-report.css");
    if (!reportXsl.exists()) {
        FileUtil.copy(XmlReportOutputter.class.getResourceAsStream("ivy-report.xsl"),
            reportXsl, null);
    }
    if (!reportCss.exists()) {
        FileUtil.copy(XmlReportOutputter.class.getResourceAsStream("ivy-report.css"),
            reportCss, null);
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:25,代码来源:XmlReportOutputter.java

示例3: findPath

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
private Collection<IvyNode> findPath(ModuleId from, IvyNode node, List<IvyNode> path) {
    IvyNode parent = node.getDirectCallerFor(from);
    if (parent == null) {
        throw new IllegalArgumentException("no path from " + from + " to " + getId() + " found");
    }
    if (path.contains(parent)) {
        path.add(0, parent);
        Message.verbose(
            "circular dependency found while looking for the path for another one: was looking for "
                    + from + " as a caller of " + path.get(path.size() - 1));
        return path;
    }
    path.add(0, parent);
    if (parent.getId().getModuleId().equals(from)) {
        return path;
    }
    return findPath(from, parent, path);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:19,代码来源:IvyNode.java

示例4: download

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@Override
public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
    ensureConfigured();
    clearArtifactAttempts();
    DownloadReport dr = new DownloadReport();
    for (Artifact artifact : artifacts) {
        final ArtifactDownloadReport adr = new ArtifactDownloadReport(artifact);
        dr.addArtifactReport(adr);
        ResolvedResource artifactRef = getArtifactRef(artifact, null);
        if (artifactRef != null) {
            Message.verbose("\t[NOT REQUIRED] " + artifact);
            ArtifactOrigin origin = new ArtifactOrigin(artifact, true, artifactRef
                    .getResource().getName());
            File archiveFile = ((FileResource) artifactRef.getResource()).getFile();
            adr.setDownloadStatus(DownloadStatus.NO);
            adr.setSize(archiveFile.length());
            adr.setArtifactOrigin(origin);
            adr.setLocalFile(archiveFile);
        } else {
            adr.setDownloadStatus(DownloadStatus.FAILED);
        }
    }
    return dr;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:25,代码来源:CacheResolver.java

示例5: tryLock

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@SuppressWarnings("resource")
public boolean tryLock(File file) {
    try {
        if (file.getParentFile().exists() || file.getParentFile().mkdirs()) {
            // this must not be closed until unlock
            RandomAccessFile raf = new RandomAccessFile(file, "rw");
            FileLock l = raf.getChannel().tryLock();
            if (l != null) {
                synchronized (this) {
                    locks.put(file, new LockData(raf, l));
                }
                return true;
            } else {
                if (debugLocking) {
                    debugLocking("failed to acquire lock on " + file);
                }
            }
        }
    } catch (IOException e) {
        // ignored
        Message.verbose("file lock failed due to an exception: " + e.getMessage() + " ("
                + file + ")");
    }
    return false;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:26,代码来源:FileBasedLockStrategy.java

示例6: 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

示例7: unpack

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@Override
public void unpack(InputStream packed, File dest) throws IOException {
    try (ZipInputStream zip = new ZipInputStream(packed)) {
        ZipEntry entry = null;
        while (((entry = zip.getNextEntry()) != null)) {
            File f = new File(dest, entry.getName());
            Message.verbose("\t\texpanding " + entry.getName() + " to " + f);

            // create intermediary directories - sometimes zip don't add them
            File dirF = f.getParentFile();
            if (dirF != null) {
                dirF.mkdirs();
            }

            if (entry.isDirectory()) {
                f.mkdirs();
            } else {
                writeFile(zip, f);
            }

            f.setLastModified(entry.getTime());
        }
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:25,代码来源:ZipPacking.java

示例8: interrupt

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
 * Interrupts the current running operation in the given operating thread, no later than
 * interruptTimeout milliseconds after the call
 *
 * @param operatingThread Thread
 */
@SuppressWarnings("deprecation")
public void interrupt(Thread operatingThread) {
    if (operatingThread != null && operatingThread.isAlive()) {
        if (operatingThread == Thread.currentThread()) {
            throw new IllegalStateException("cannot call interrupt from ivy operating thread");
        }
        Message.verbose("interrupting operating thread...");
        operatingThread.interrupt();
        synchronized (this) {
            interrupted = true;
        }
        try {
            Message.verbose("waiting clean interruption of operating thread");
            operatingThread.join(settings.getInterruptTimeout());
        } catch (InterruptedException e) {
            // reset thread interrupt status
            Thread.currentThread().interrupt();
        }
        if (operatingThread.isAlive()) {
            Message.warn("waited clean interruption for too long: stopping operating thread");
            operatingThread.stop();
        }
        synchronized (this) {
            interrupted = false;
        }
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:34,代码来源:Ivy.java

示例9: blacklist

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
 * Blacklists the current node, so that a new resolve process won't ever consider this node as
 * available in the repository.
 * <p>
 * This is useful in combination with {@link RestartResolveProcess} for conflict manager
 * implementation which use a best effort strategy to find compatible dependency set, like
 * {@link LatestCompatibleConflictManager}
 * </p>
 *
 * @param bdata
 *            the root module configuration in which the node should be blacklisted
 */
public void blacklist(IvyNodeBlacklist bdata) {
    if (data.getSettings().logResolvedRevision()) {
        Message.info("BLACKLISTING " + bdata);
    } else {
        Message.verbose("BLACKLISTING " + bdata);
    }

    Stack<IvyNode> callerStack = new Stack<>();
    callerStack.push(this);
    clearEvictionDataInAllCallers(bdata.getRootModuleConf(), callerStack);

    usage.blacklist(bdata);
    data.blacklist(this);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:27,代码来源:IvyNode.java

示例10: releaseChannelSftp

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
 * remove channelSftp and disconnect if necessary
 */
public void releaseChannelSftp() {
    if (channelSftp != null) {
        if (channelSftp.isConnected()) {
            Message.verbose(":: SFTP :: closing sftp connection from " + host + "...");
            channelSftp.disconnect();
            channelSftp = null;
            Message.verbose(":: SFTP :: sftp connection closed from " + host);
        }
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:14,代码来源:SshCache.java

示例11: progress

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
public void progress(IvyEvent event) {
    Project project = (Project) IvyContext.peekInContextStack(IvyTask.ANT_PROJECT_CONTEXT_KEY);
    if (project == null) {
        Message.info("ant call trigger can only be used from an ant build. Ignoring.");
        return;
    }
    if (onlyonce && isTriggered(event)) {
        Message.verbose("call already triggered for this event, skipping: " + event);
    } else {
        CallTarget call = new CallTarget();

        call.setProject(project);
        call.setTaskName("antcall");

        Map<String, String> attributes = event.getAttributes();
        String target = IvyPatternHelper.substituteTokens(getTarget(), attributes);
        call.setTarget(target);

        for (Map.Entry<String, String> entry : attributes.entrySet()) {
            Property p = call.createParam();
            p.setName(prefix == null ? entry.getKey() : prefix + entry.getKey());
            p.setValue(entry.getValue() == null ? "" : entry.getValue());
        }

        Message.verbose("triggering ant call: target=" + target + " for " + event);
        call.execute();
        markTriggered(event);

        Message.debug("triggered ant call finished: target=" + target + " for " + event);
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:32,代码来源:AntCallTrigger.java

示例12: getSession

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
 * Gets a session from the cache or establishes a new session if necessary
 *
 * @param host
 *            to connect to
 * @param port
 *            to use for session (-1 == use standard port)
 * @param username
 *            for the session to use
 * @param userPassword
 *            to use for authentication (optional)
 * @param pemFile
 *            File to use for public key authentication
 * @param pemPassword
 *            to use for accessing the pemFile (optional)
 * @param passFile
 *            to store credentials
 * @param allowedAgentUse
 *            Whether to communicate with an agent for authentication
 * @return session or null if not successful
 * @throws IOException if something goes wrong
 */
public Session getSession(String host, int port, String username, String userPassword,
        File pemFile, String pemPassword, File passFile, boolean allowedAgentUse)
        throws IOException {
    Checks.checkNotNull(host, "host");
    Checks.checkNotNull(username, "user");
    Entry entry = getCacheEntry(username, host, port);
    Session session = null;
    if (entry != null) {
        session = entry.getSession();
    }
    if (session == null || !session.isConnected()) {
        Message.verbose(":: SSH :: connecting to " + host + "...");
        try {
            JSch jsch = new JSch();
            if (port != -1) {
                session = jsch.getSession(username, host, port);
            } else {
                session = jsch.getSession(username, host);
            }
            if (allowedAgentUse) {
                attemptAgentUse(jsch);
            }
            if (pemFile != null) {
                jsch.addIdentity(pemFile.getAbsolutePath(), pemPassword);
            }
            session.setUserInfo(new CfUserInfo(host, username, userPassword, pemFile,
                    pemPassword, passFile));
            session.setDaemonThread(true);

            Properties config = new Properties();
            config.setProperty("PreferredAuthentications",
                "publickey,keyboard-interactive,password");
            session.setConfig(config);

            session.connect();
            Message.verbose(":: SSH :: connected to " + host + "!");
            setSession(username, host, port, session);
        } catch (JSchException e) {
            if (passFile != null && passFile.exists()) {
                passFile.delete();
            }
            throw new IOException(e.getMessage(), e);
        }
    }
    return session;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:69,代码来源:SshCache.java

示例13: disconnect

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
public synchronized void disconnect() {
    if (in != null) {
        Message.verbose("disconnecting from " + getHost() + "... ");
        try {
            sendCommand("exit", false, DISCONNECT_COMMAND_TIMEOUT);
        } catch (IOException e) {
            // nothing I can do
        } finally {
            closeConnection();
            Message.verbose("disconnected of " + getHost());
        }
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:14,代码来源:VsftpRepository.java

示例14: dumpSettings

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@Override
public void dumpSettings() {
    Message.verbose("\t" + getName() + " [chain] " + chain);
    Message.debug("\t\treturn first: " + isReturnFirst());
    Message.debug("\t\tdual: " + isDual());
    for (DependencyResolver resolver : chain) {
        Message.debug("\t\t-> " + resolver.getName());
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:10,代码来源:ChainResolver.java

示例15: outputReport

import org.apache.ivy.util.Message; //导入方法依赖的package包/类
public void outputReport(ResolveReport report, ResolutionCacheManager cacheMgr,
        ResolveOptions options) throws IOException {
    if (ResolveOptions.LOG_DEFAULT.equals(options.getLog())) {
        Message.info(":: resolution report :: resolve " + report.getResolveTime() + "ms"
                + " :: artifacts dl " + report.getDownloadTime() + "ms");
    } else {
        Message.verbose(":: resolution report :: resolve " + report.getResolveTime() + "ms"
                + " :: artifacts dl " + report.getDownloadTime() + "ms");
    }
    report.setProblemMessages(Message.getProblems());
    // output report
    report.output(settings.getReportOutputters(), cacheMgr, options);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:14,代码来源:ResolveEngine.java


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