本文整理匯總了Java中org.tmatesoft.svn.core.SVNURL.appendPath方法的典型用法代碼示例。如果您正苦於以下問題:Java SVNURL.appendPath方法的具體用法?Java SVNURL.appendPath怎麽用?Java SVNURL.appendPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.tmatesoft.svn.core.SVNURL
的用法示例。
在下文中一共展示了SVNURL.appendPath方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createHandler
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@NotNull
private static DirectoryEntryConsumer createHandler(@NotNull final SvnBranchConfigurationNew result, @NotNull final SVNURL rootPath) {
return new DirectoryEntryConsumer() {
@Override
public void consume(final DirectoryEntry entry) throws SVNException {
if (entry.isDirectory()) {
SVNURL childUrl = rootPath.appendPath(entry.getName(), false);
if (StringUtil.endsWithIgnoreCase(entry.getName(), DEFAULT_TRUNK_NAME)) {
result.setTrunkUrl(childUrl.toString());
}
else {
result.addBranches(childUrl.toString(),
new InfoStorage<List<SvnBranchItem>>(new ArrayList<SvnBranchItem>(0), InfoReliability.defaultValues));
}
}
}
};
}
示例2: update
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
private void update() {
RepositoryTreeNode baseNode = myBrowser.getSelectedNode();
if (baseNode == null) {
myTargetURL.setText("");
getOKAction().setEnabled(false);
return;
}
SVNURL baseURL = baseNode.getURL();
String name = myNameField.getText();
if (name == null || "".equals(name)) {
getOKAction().setEnabled(false);
return;
}
try {
baseURL = baseURL.appendPath(myNameField.getText(), false);
} catch (SVNException e) {
//
getOKAction().setEnabled(false);
return;
}
myTargetURL.setText(baseURL.toString());
getOKAction().setEnabled(!myURL.toString().equals(myTargetURL.getText()));
}
示例3: annotateNonExisting
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
private SvnRemoteFileAnnotation annotateNonExisting(Pair<SvnChangeList, FilePath> pair,
VcsFileRevision revision,
Info info,
Charset charset, final VirtualFile current) throws VcsException, SVNException, IOException {
final File wasFile = pair.getSecond().getIOFile();
final File root = getCommonAncestor(wasFile, info.getFile());
if (root == null) throw new VcsException("Can not find relative path for " + wasFile.getPath() + "@" + revision.getRevisionNumber().asString());
final String relativePath = FileUtil.getRelativePath(root.getPath(), wasFile.getPath(), File.separatorChar);
if (relativePath == null) throw new VcsException("Can not find relative path for " + wasFile.getPath() + "@" + revision.getRevisionNumber().asString());
Info wcRootInfo = myVcs.getInfo(root);
if (wcRootInfo == null || wcRootInfo.getURL() == null) {
throw new VcsException("Can not find relative path for " + wasFile.getPath() + "@" + revision.getRevisionNumber().asString());
}
SVNURL wasUrl = wcRootInfo.getURL();
final String[] strings = relativePath.replace('\\','/').split("/");
for (String string : strings) {
wasUrl = wasUrl.appendPath(string, true);
}
final SVNRevision svnRevision = ((SvnRevisionNumber)revision.getRevisionNumber()).getRevision();
byte[] data = SvnUtil.getFileContents(myVcs, SvnTarget.fromURL(wasUrl), svnRevision, svnRevision);
final String contents = LoadTextUtil.getTextByBinaryPresentation(data, charset == null ? CharsetToolkit.UTF8_CHARSET : charset).toString();
final SvnRemoteFileAnnotation result = new SvnRemoteFileAnnotation(myVcs, contents, revision.getRevisionNumber(), current);
final AnnotationConsumer annotateHandler = createAnnotationHandler(ProgressManager.getInstance().getProgressIndicator(), result);
final boolean calculateMergeinfo = SvnConfiguration.getInstance(myVcs.getProject()).isShowMergeSourcesInAnnotate() &&
SvnUtil.checkRepositoryVersion15(myVcs, wasUrl.toString());
AnnotateClient client = myVcs.getFactory().createAnnotateClient();
client
.annotate(SvnTarget.fromURL(wasUrl, svnRevision), SVNRevision.create(1), svnRevision, calculateMergeinfo, getLogClientOptions(myVcs),
annotateHandler);
return result;
}
示例4: appendMultiParts
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public static SVNURL appendMultiParts(@NotNull final SVNURL base, @NotNull final String subPath) throws SVNException {
if (StringUtil.isEmpty(subPath)) return base;
final List<String> parts = StringUtil.split(subPath.replace('\\', '/'), "/", true);
SVNURL result = base;
for (String part : parts) {
result = result.appendPath(part, false);
}
return result;
}
示例5: append
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public static SVNURL append(@NotNull SVNURL parent, String child) {
try {
return parent.appendPath(child, false);
}
catch (SVNException e) {
throw createIllegalArgument(e);
}
}
示例6: toDirectoryEntry
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@NotNull
public DirectoryEntry toDirectoryEntry(@NotNull SVNURL url, @Nullable SVNURL repositoryUrl) throws SVNException {
return new DirectoryEntry(url.appendPath(name, false), repositoryUrl, PathUtil.getFileName(name), kind,
commit != null ? commit.build() : null, name);
}
示例7: checkout
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
/**
* @작성자 : KYJ
* @작성일 : 2017. 12. 20.
* @param path
* @param pegrevision
* @param revision
* @param outDir
* @param exceptionHandler
* @return
* @throws Exception
*/
public Long checkout(String path, SVNRevision pegrevision, SVNRevision revision, File outDir, ExceptionHandler exceptionHandler)
throws Exception {
SVNURL root = getSvnURL();
SVNURL pathURL = root;
if (ValueUtil.isNotEmpty(path)) {
pathURL = root.appendPath(path, true);
}
return checkout(pathURL, pegrevision, revision, outDir, exceptionHandler);
}