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


Java SvnTarget.isFile方法代码示例

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


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

示例1: annotate

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@Override
public void annotate(@NotNull SvnTarget target,
                     @NotNull SVNRevision startRevision,
                     @NotNull SVNRevision endRevision,
                     boolean includeMergedRevisions,
                     @Nullable DiffOptions diffOptions,
                     @Nullable AnnotationConsumer handler) throws VcsException {
  try {
    SVNLogClient client = myVcs.getSvnKitManager().createLogClient();

    client.setDiffOptions(toDiffOptions(diffOptions));
    if (target.isFile()) {
      client
        .doAnnotate(target.getFile(), target.getPegRevision(), startRevision, endRevision, true, includeMergedRevisions,
                    toAnnotateHandler(handler), null);
    }
    else {
      client
        .doAnnotate(target.getURL(), target.getPegRevision(), startRevision, endRevision, true, includeMergedRevisions,
                    toAnnotateHandler(handler), null);
    }
  }
  catch (SVNException e) {
    throw new VcsException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnKitAnnotateClient.java

示例2: append

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
public static SvnTarget append(@NotNull SvnTarget target, @NotNull String path, boolean checkAbsolute) throws SvnBindException {
  SvnTarget result;

  if (target.isFile()) {
    result = SvnTarget.fromFile(resolvePath(target.getFile(), path));
  }
  else {
    try {
      result = SvnTarget
        .fromURL(checkAbsolute && URI.create(path).isAbsolute() ? SVNURL.parseURIEncoded(path) : target.getURL().appendPath(path, false));
    }
    catch (SVNException e) {
      throw new SvnBindException(e);
    }
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SvnUtil.java

示例3: getProperty

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@Nullable
@Override
public PropertyValue getProperty(@NotNull SvnTarget target,
                                 @NotNull String property,
                                 boolean revisionProperty,
                                 @Nullable SVNRevision revision) throws VcsException {
  PropertyData resultData;

  try {
    if (!revisionProperty) {
      if (target.isFile()) {
        resultData = PropertyData.create(createClient().doGetProperty(target.getFile(), property, target.getPegRevision(), revision));
      } else {
        resultData = PropertyData.create(createClient().doGetProperty(target.getURL(), property, target.getPegRevision(), revision));
      }
    } else {
      resultData = getRevisionProperty(target, property, revision);
    }
  }
  catch (SVNException e) {
    throw new VcsException(e);
  }

  return resultData != null ? resultData.getValue() : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:SvnKitPropertyClient.java

示例4: setRevisionProperty

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@Override
public void setRevisionProperty(@NotNull SvnTarget target,
                                @NotNull String property,
                                @NotNull SVNRevision revision,
                                @Nullable PropertyValue value,
                                boolean force) throws VcsException {
  try {
    if (target.isFile()) {
      createClient().doSetRevisionProperty(target.getFile(), revision, property, toPropertyValue(value), force, null);
    }
    else {
      createClient().doSetRevisionProperty(target.getURL(), revision, property, toPropertyValue(value), force, null);
    }
  }
  catch (SVNException e) {
    throw new SvnBindException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SvnKitPropertyClient.java

示例5: compare

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
@Override
public List<Change> compare(@NotNull SvnTarget target1, @NotNull SvnTarget target2) throws VcsException {
  assertUrl(target1);
  if (target2.isFile()) {
    // Such combination (file and url) with "--summarize" option is supported only in svn 1.8.
    // For svn 1.7 "--summarize" is only supported when both targets are repository urls.
    assertDirectory(target2);

    WorkingCopyFormat format = WorkingCopyFormat.from(myFactory.createVersionClient().getVersion());
    if (format.less(WorkingCopyFormat.ONE_DOT_EIGHT)) {
      throw new SvnBindException("Could not compare local file and remote url with executable for svn " + format);
    }
  }

  List<String> parameters = new ArrayList<String>();
  CommandUtil.put(parameters, target1);
  CommandUtil.put(parameters, target2);
  parameters.add("--xml");
  parameters.add("--summarize");

  CommandExecutor executor = execute(myVcs, target1, SvnCommandName.diff, parameters, null);
  return parseOutput(target1, target2, executor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:CmdDiffClient.java

示例6: export

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@Override
public void export(@NotNull SvnTarget from,
                   @NotNull File to,
                   @Nullable SVNRevision revision,
                   @Nullable Depth depth,
                   @Nullable String nativeLineEnd,
                   boolean force,
                   boolean ignoreExternals,
                   @Nullable ProgressTracker handler) throws VcsException {
  SVNUpdateClient client = myVcs.getSvnKitManager().createUpdateClient();

  client.setEventHandler(toEventHandler(handler));
  client.setIgnoreExternals(ignoreExternals);

  try {
    if (from.isFile()) {
      client.doExport(from.getFile(), to, from.getPegRevision(), revision, nativeLineEnd, force, toDepth(depth));
    }
    else {
      client.doExport(from.getURL(), to, from.getPegRevision(), revision, nativeLineEnd, force, toDepth(depth));
    }
  }
  catch (SVNException e) {
    throw new SvnBindException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnKitExportClient.java

示例7: list

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@Override
public void list(@NotNull SvnTarget target,
                 @Nullable SVNRevision revision,
                 @Nullable Depth depth,
                 @Nullable DirectoryEntryConsumer handler) throws VcsException {
  assertUrl(target);

  SVNLogClient client = getLogClient();
  ISVNDirEntryHandler wrappedHandler = wrapHandler(handler);

  client.setIgnoreExternals(true);
  try {
    if (target.isFile()) {
      client.doList(target.getFile(), target.getPegRevision(), notNullize(revision), true, toDepth(depth), SVNDirEntry.DIRENT_ALL, wrappedHandler);
    }
    else {
      client.doList(target.getURL(), target.getPegRevision(), notNullize(revision), true, toDepth(depth), SVNDirEntry.DIRENT_ALL, wrappedHandler);
    }
  }
  catch (SVNException e) {
    throw new SvnBindException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:SvnKitBrowseClient.java

示例8: doLog

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@Override
public void doLog(@NotNull SvnTarget target,
                  @NotNull SVNRevision startRevision,
                  @NotNull SVNRevision endRevision,
                  boolean stopOnCopy,
                  boolean discoverChangedPaths,
                  boolean includeMergedRevisions,
                  long limit,
                  @Nullable String[] revisionProperties,
                  @Nullable LogEntryConsumer handler) throws VcsException {
  try {
    SVNLogClient client = myVcs.getSvnKitManager().createLogClient();

    if (target.isFile()) {
      client.doLog(new File[]{target.getFile()}, startRevision, endRevision, target.getPegRevision(), stopOnCopy, discoverChangedPaths,
                   includeMergedRevisions, limit, revisionProperties, toHandler(handler));
    }
    else {
      client.doLog(target.getURL(), ArrayUtil.EMPTY_STRING_ARRAY, target.getPegRevision(), startRevision, endRevision, stopOnCopy,
                   discoverChangedPaths, includeMergedRevisions, limit, revisionProperties, toHandler(handler));
    }
  }
  catch (SVNException e) {
    throw new SvnBindException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnKitHistoryClient.java

示例9: resolveWorkingDirectory

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
private File resolveWorkingDirectory(@NotNull Command command) {
  SvnTarget target = command.getTarget();
  File workingDirectory = target.isFile() ? target.getFile() : null;
  // TODO: Do we really need search existing parent - or just take parent directory if target is file???
  workingDirectory = CommandUtil.findExistingParent(workingDirectory);

  return workingDirectory != null ? workingDirectory : getDefaultWorkingDirectory(myVcs.getProject());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CommandParametersResolutionModule.java

示例10: invokeHandler

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
private static void invokeHandler(@NotNull SvnTarget target, @Nullable PropertyData data, @Nullable PropertyConsumer handler)
  throws SVNException {
  if (handler != null && data != null) {
    if (target.isFile()) {
      handler.handleProperty(target.getFile(), data);
    } else {
      handler.handleProperty(target.getURL(), data);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CmdPropertyClient.java

示例11: copy

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@Override
public long copy(@NotNull SvnTarget source,
                 @NotNull SvnTarget destination,
                 @Nullable SVNRevision revision,
                 boolean makeParents,
                 boolean isMove,
                 @NotNull String message,
                 @Nullable CommitEventHandler handler) throws VcsException {
  if (!destination.isURL()) {
    throw new IllegalArgumentException("Only urls are supported as destination " + destination);
  }

  List<String> parameters = new ArrayList<String>();

  CommandUtil.put(parameters, source);
  CommandUtil.put(parameters, destination);
  CommandUtil.put(parameters, revision);
  CommandUtil.put(parameters, makeParents, "--parents");
  parameters.add("--message");
  parameters.add(message);

  // copy to url output is the same as commit output - just statuses have "copy of" suffix
  // so "Adding" will be "Adding copy of"
  CmdCheckinClient.CommandListener listener = new CmdCheckinClient.CommandListener(handler);
  if (source.isFile()) {
    listener.setBaseDirectory(source.getFile());
  }
  execute(myVcs, source, getCommandName(isMove), parameters, listener);

  return listener.getCommittedRevision();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:CmdCopyMoveClient.java

示例12: assertFile

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
protected void assertFile(@NotNull SvnTarget target) {
  if (!target.isFile()) {
    throw new IllegalArgumentException("Target should be file " + target);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:BaseSvnClient.java

示例13: createFilePath

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
private static FilePath createFilePath(@NotNull SvnTarget target, boolean isDirectory) {
  return target.isFile()
         ? VcsUtil.getFilePath(target.getFile(), isDirectory)
         : VcsUtil.getFilePathOnNonLocal(SvnUtil.toDecodedString(target), isDirectory);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:CmdDiffClient.java

示例14: createCopySource

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
private static SVNCopySource createCopySource(@NotNull SvnTarget source, @Nullable SVNRevision revision) {
  return source.isFile()
         ? new SVNCopySource(source.getPegRevision(), revision, source.getFile())
         : new SVNCopySource(source.getPegRevision(), revision, source.getURL());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:SvnKitCopyMoveClient.java

示例15: getFactory

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
public ClientFactory getFactory(@NotNull SvnTarget target) {
  return target.isFile() ? getFactory(target.getFile()) : getFactory();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:SvnVcs.java


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