本文整理汇总了Java中org.apache.ivy.util.Message.debug方法的典型用法代码示例。如果您正苦于以下问题:Java Message.debug方法的具体用法?Java Message.debug怎么用?Java Message.debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ivy.util.Message
的用法示例。
在下文中一共展示了Message.debug方法的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;
}
示例2: get
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
* Handles a request to retrieve a file from the repository.
*
* @param source Path to the resource to retrieve, including the repository root.
* @param destination The location where the file should be retrieved to.
* @throws IOException If an error occurs retrieving the file.
*/
public void get(String source, File destination) throws IOException {
fireTransferInitiated(getResource(source), TransferEvent.REQUEST_GET);
String repositorySource = source;
if (!source.startsWith(repositoryRoot)) {
repositorySource = getRepositoryRoot() + source;
}
Message.debug("Getting file for user " + userName + " from " + repositorySource + " [revision="
+ svnRetrieveRevision + "] to " + destination.getAbsolutePath());
try {
SVNURL url = SVNURL.parseURIEncoded(repositorySource);
SVNRepository repository = getRepository(url, true);
repository.setLocation(url, false);
Resource resource = getResource(source);
fireTransferInitiated(resource, TransferEvent.REQUEST_GET);
SvnDao svnDAO = new SvnDao(repository);
svnDAO.getFile(url, destination, svnRetrieveRevision);
fireTransferCompleted(destination.length());
} catch (SVNException e) {
Message.error("Error retrieving" + repositorySource + " [revision=" + svnRetrieveRevision + "]");
throw (IOException) new IOException().initCause(e);
}
}
示例3: resolveResource
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
* Fetch the needed file information for a given file (size, last modification time) and report it back in a
* SvnResource.
*
* @param repositorySource Full path to resource in subversion (including host, protocol etc.)
* @return SvnResource filled with the needed informations
*/
protected SvnResource resolveResource(String repositorySource) {
Message.debug("Resolving resource for " + repositorySource + " [revision=" + svnRetrieveRevision + "]");
SvnResource result = null;
try {
SVNURL url = SVNURL.parseURIEncoded(repositorySource);
SVNRepository repository = getRepository(url, true);
SVNNodeKind nodeKind = repository.checkPath("", svnRetrieveRevision);
if (nodeKind == SVNNodeKind.NONE) {
// log this on debug, NOT error, see http://code.google.com/p/ivysvn/issues/detail?id=21
Message.debug("No resource found at " + repositorySource + ", returning default resource");
result = new SvnResource();
} else {
Message.debug("Resource found at " + repositorySource + ", returning resolved resource");
SVNDirEntry entry = repository.info("", svnRetrieveRevision);
result = new SvnResource(this, repositorySource, true, entry.getDate().getTime(), entry.getSize());
}
} catch (SVNException e) {
Message.error("Error resolving resource " + repositorySource + ", " + e.getMessage());
Message.debug("Exception is: " + getStackTrace(e)); // useful for debugging network issues
result = new SvnResource();
}
return result;
}
示例4: commitTree
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
* Commits the contents of the passed DirectoryTree.
*
* @param tree Tree containing PutOperations to commit.
* @return The number of files committed. put operations.
* @throws SVNException If an error occurs performing any of the put operations.
* @throws IOException If an error occurs reading any file data.
*/
private int commitTree(DirectoryTree tree) throws SVNException, IOException {
int fileCount = 0;
if (tree.getParent() != null) {
if (svnDAO.folderExists(tree.getPath(), -1, true)) { // open dir to correct path in tree
commitEditor.openDir(tree.getPath(), -1);
} else {
Message.debug("Creating folder " + tree.getPath());
commitEditor.addDir(tree.getPath(), null, -1);
}
}
for (DirectoryTree subDir : tree.getSubDirectoryTrees()) {
fileCount += commitTree(subDir);
}
fileCount += performPutOperations(tree.getPutOperations()); // perform put operations at current open dir
if (tree.getParent() != null) {
commitEditor.closeDir(); // finished with this path, close dir
}
return fileCount;
}
示例5: putFile
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
* Puts a file into Subversion, does update or add depending on whether file already exists or not. Folder containing
* file *must* already exist.
*
* @param editor An initialised commit editor.
* @param data File data as a byte array.
* @param destinationFolder Destination folder in svn.
* @param fileName File name.
* @param overwrite Whether existing file should be overwritten or not.
* @return true if File was updated or added, false if it was ignored (i.e. it already exists and overwrite was
* false).
* @throws SVNException If an error occurs putting the file into Subversion.
*/
public boolean putFile(ISVNEditor editor, byte[] data, String destinationFolder, String fileName, boolean overwrite)
throws SVNException {
String filePath = destinationFolder + "/" + fileName;
if (fileExists(filePath, -1)) { // updating existing file
if (overwrite) {
Message.debug("Updating file " + filePath);
editor.openFile(filePath, -1);
} else {
Message.info("Overwrite set to false, ignoring " + filePath);
return false;
}
} else { // creating new file
Message.debug("Adding file " + filePath);
editor.addFile(filePath, null, -1);
}
editor.applyTextDelta(filePath, null);
SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
String checksum = deltaGenerator.sendDelta(filePath, new ByteArrayInputStream(data), editor, true);
editor.closeFile(filePath, checksum);
return true;
}
示例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;
}
示例7: getFromCache
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
ModuleDescriptor getFromCache(File ivyFile, ParserSettings ivySettings, boolean validated) {
if (maxSize <= 0) {
// cache is disabled
return null;
}
CacheEntry entry = valueMap.get(ivyFile);
if (entry != null) {
if (entry.isStale(validated, ivySettings)) {
Message.debug("Entry is found in the ModuleDescriptorCache but entry should be "
+ "reevaluated : " + ivyFile);
valueMap.remove(ivyFile);
return null;
} else {
// Move the entry at the end of the list
valueMap.remove(ivyFile);
valueMap.put(ivyFile, entry);
Message.debug("Entry is found in the ModuleDescriptorCache : " + ivyFile);
return entry.md;
}
} else {
Message.debug("No entry is found in the ModuleDescriptorCache : " + ivyFile);
return null;
}
}
示例8: getModuleDescriptors
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
private synchronized Map<ModuleDescriptor, File> getModuleDescriptors() {
if (md2IvyFile == null) {
md2IvyFile = new HashMap<>();
for (ResourceCollection resources : allResources) {
for (Resource resource : resources) {
File ivyFile = ((FileResource) resource).getFile();
try {
ModuleDescriptor md = ModuleDescriptorParserRegistry.getInstance()
.parseDescriptor(getParserSettings(), ivyFile.toURI().toURL(),
isValidate());
md2IvyFile.put(md, ivyFile);
Message.debug("Add " + md.getModuleRevisionId().getModuleId());
} catch (Exception ex) {
if (haltOnError) {
throw new BuildException("impossible to parse ivy file " + ivyFile
+ " exception=" + ex, ex);
} else {
Message.warn("impossible to parse ivy file " + ivyFile
+ " exception=" + ex.getMessage());
}
}
}
}
}
return md2IvyFile;
}
示例9: getRevision
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
private ModuleRevisionId getRevision(ResolvedResource ivyRef, ModuleRevisionId askedMrid,
ModuleDescriptor md) {
Map<String, String> allAttributes = new HashMap<>();
allAttributes.putAll(md.getQualifiedExtraAttributes());
allAttributes.putAll(askedMrid.getQualifiedExtraAttributes());
String revision = ivyRef.getRevision();
if (revision == null) {
Message.debug("no revision found in reference for " + askedMrid);
if (getSettings().getVersionMatcher().isDynamic(askedMrid)) {
if (md.getModuleRevisionId().getRevision() == null) {
revision = "[email protected]" + getName();
} else {
Message.debug("using " + askedMrid);
revision = askedMrid.getRevision();
}
} else {
Message.debug("using " + askedMrid);
revision = askedMrid.getRevision();
}
}
return ModuleRevisionId.newInstance(askedMrid.getOrganisation(), askedMrid.getName(),
askedMrid.getBranch(), revision, allAttributes);
}
示例10: analyse
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
public void analyse(String pattern, DependencyAnalyser depAnalyser) {
JarModuleFinder finder = new JarModuleFinder(pattern);
ModuleDescriptor[] mds = depAnalyser.analyze(finder.findJarModules());
Message.info("found " + mds.length + " modules");
for (ModuleDescriptor md : mds) {
File ivyFile = new File(IvyPatternHelper.substitute(
pattern,
DefaultArtifact.newIvyArtifact(md.getModuleRevisionId(),
md.getPublicationDate())));
try {
Message.info("generating " + ivyFile);
XmlModuleDescriptorWriter.write(md, ivyFile);
} catch (IOException e) {
Message.debug(e);
}
}
}
示例11: buildModuleRevisionId
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
private ModuleRevisionId buildModuleRevisionId(String moduleRevisionId, PluginType pluginType) {
String mrid = moduleRevisionId;
if (!mrid.matches(".*#.*")) {
if (pluginType.equals(PluginType.BUILDTYPE)) {
Message.debug("No organisation specified for buildtype " + mrid + " using the default one");
mrid = EasyAntConstants.EASYANT_BUILDTYPES_ORGANISATION + "#" + mrid;
} else {
Message.debug("No organisation specified for plugin " + mrid + " using the default one");
mrid = EasyAntConstants.EASYANT_PLUGIN_ORGANISATION + "#" + mrid;
}
}
return ModuleRevisionId.parse(mrid);
}
示例12: commitPublishTransaction
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
* Commits the previously started publish transaction.
*
* @throws IOException If an error occurs committing the transaction.
*/
public void commitPublishTransaction() throws IOException {
ensurePublishTransaction();
Message.debug("Committing transaction...");
try {
publishTransaction.commit();
publishTransaction = null;
} catch (SVNException e) {
throw (IOException) new IOException().initCause(e);
}
}
示例13: put
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
* Handles a request to add/update a file to/in the repository.
*
* @param source The source file.
* @param destination The location of the file in the repository.
* @param overwrite Whether to overwite the file if it already exists.
* @throws IOException If an error occurs putting a file (invalid path, invalid login credentials etc.)
*/
public void put(File source, String destination, boolean overwrite) throws IOException {
fireTransferInitiated(getResource(destination), TransferEvent.REQUEST_PUT);
Message.debug("Scheduling publish from " + source.getAbsolutePath() + " to " + getRepositoryRoot() + destination);
Message.info("Scheduling publish to " + getRepositoryRoot() + destination);
try {
SVNURL destinationURL = SVNURL.parseURIEncoded(getRepositoryRoot() + destination);
if (publishTransaction == null) { // haven't initialised transaction on a previous put
// first create a repository which transaction can use for various file checks
SVNURL repositoryRootURL = SVNURL.parseURIEncoded(getRepositoryRoot());
SVNRepository ancillaryRepository = getRepository(repositoryRootURL, false);
SvnDao svnDAO = new SvnDao(ancillaryRepository);
// now create another repository which transaction will use to do actual commits
SVNRepository commitRepository = getRepository(destinationURL, false);
publishTransaction = new SvnPublishTransaction(svnDAO, moduleRevisionId, commitRepository, repositoryRootURL);
publishTransaction.setBinaryDiff(binaryDiff);
publishTransaction.setBinaryDiffFolderName(binaryDiffFolderName);
publishTransaction.setCleanupPublishFolder(cleanupPublishFolder);
}
// add all info needed to put the file to the transaction
publishTransaction.addPutOperation(source, destination, overwrite);
} catch (SVNException e) {
throw (IOException) new IOException().initCause(e);
}
}
示例14: setProxy
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
* Set the proxy for a {@link BasicAuthenticationManager}.
*
* @param authManager The authentication manager to set the proxy server on.
*/
public void setProxy(final BasicAuthenticationManager authManager) {
if (proxyHost != null) {
Message.debug(String.format("The proxy server is %s:%s. The proxy username is %s", proxyHost, Integer
.toString(proxyPort), proxyUser));
authManager.setProxy(proxyHost, proxyPort, proxyUser, proxyPassword);
}
}
示例15: createFolders
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
/**
* Creates the passed folder in the repository, existing folders are left alone and only the parts of the path which
* don't exist are created.
*
* @param editor An editor opened for performing commits.
* @param folderPath The path of the folder to create, must be relative to the root of the repository.
* @param revision Revision to use.
* @return boolean indicating whether at least one folder was created or not.
* @throws SVNException If an invalid path is passed or the path could not be created.
*/
public boolean createFolders(ISVNEditor editor, String folderPath, long revision) throws SVNException {
boolean folderCreated = false;
// run through all directories in path and create whatever is necessary
String[] folders = folderPath.split("/");
int i = 0;
StringBuffer existingPath = new StringBuffer("");
StringBuffer pathToCheck = new StringBuffer(folders[0]);
while (folderExists(pathToCheck.toString(), revision, true)) {
existingPath.append(folders[i] + "/");
if (++i == folders.length) {
break;// no more paths to check, entire path exists so break out of here
} else {
pathToCheck.append("/" + folders[i]); // add the next part of path
}
}
if (i < folders.length) { // 1 or more dirs need to be created
editor.openDir(existingPath.toString(), -1);
for (; i < folders.length; i++) { // build up path to create
StringBuffer pathToAdd = new StringBuffer(existingPath);
if (pathToAdd.length() > 0 && pathToAdd.charAt(pathToAdd.length() - 1) != '/') { // if we need a separator char
pathToAdd.append("/");
}
pathToAdd.append(folders[i]);
Message.debug("Creating folder " + pathToAdd);
editor.addDir(pathToAdd.toString(), null, -1);
folderCreated = true;
existingPath = pathToAdd; // added to svn so this is new existing path
existingFolderPaths.add(pathToAdd.toString());
}
}
return folderCreated;
}