Tabnine Logo
SCMFileSystem
Code IndexAdd Tabnine to your IDE (free)

How to use
SCMFileSystem
in
jenkins.scm.api

Best Java code snippets using jenkins.scm.api.SCMFileSystem (Showing top 12 results out of 315)

origin: org.jenkins-ci.plugins/git

@Override
public AbstractGitSCMSource.SCMRevisionImpl getRevision() {
  return (AbstractGitSCMSource.SCMRevisionImpl) super.getRevision();
}
origin: jenkinsci/workflow-multibranch-plugin

build.addAction(new SCMRevisionAction(scmSource, tip));
SCMRevision rev = scmSource.getTrustedRevision(tip, listener);
try (SCMFileSystem fs = USE_HEAVYWEIGHT_CHECKOUT ? null : SCMFileSystem.of(scmSource, head, rev)) {
  if (fs != null) { // JENKINS-33273
    String script = null;
    try {
      script = fs.child(scriptPath).contentAsString();
      listener.getLogger().println("Obtained " + scriptPath + " from " + rev);
    } catch (IOException | InterruptedException x) {
origin: jenkinsci/subversion-plugin

@Test
public void ofSourceRevision() throws Exception {
  sampleRepo.init();
  sampleRepo.svnkit("copy", "--message=branching", sampleRepo.trunkUrl(), sampleRepo.branchesUrl() + "/dev");
  sampleRepo.svnkit("switch", sampleRepo.branchesUrl() + "/dev", sampleRepo.wc());
  SCMSource source = new SubversionSCMSource(null, sampleRepo.prjUrl());
  SCMRevision revision = source.fetch(new SCMHead("branches/dev"), null);
  sampleRepo.write("file", "modified");
  sampleRepo.svnkit("commit", "--message=dev1", sampleRepo.wc());
  try (SCMFileSystem fs = SCMFileSystem.of(source, new SCMHead("branches/dev"), revision)) {
    assertThat(fs, notNullValue());
    SCMFile root = fs.getRoot();
    assertThat(root, notNullValue());
    Iterable<SCMFile> children = root.children();
    Iterator<SCMFile> iterator = children.iterator();
    assertThat(iterator.hasNext(), is(true));
    SCMFile file = iterator.next();
    assertThat(iterator.hasNext(), is(false));
    assertThat(file.getName(), is("file"));
    assertThat(file.contentAsString(), is(""));
  }
}
origin: jenkinsci/subversion-plugin

@Test
public void lastModified_Smokes() throws Exception {
  long currentTime = isWindows() ? System.currentTimeMillis() / 1000L * 1000L : System.currentTimeMillis();
  sampleRepo.init();
  sampleRepo.svnkit("copy", "--message=branching", sampleRepo.trunkUrl(), sampleRepo.branchesUrl() + "/dev");
  sampleRepo.svnkit("switch", sampleRepo.branchesUrl() + "/dev", sampleRepo.wc());
  SCMSource source = new SubversionSCMSource(null, sampleRepo.prjUrl());
  SCMRevision revision = source.fetch(new SCMHead("branches/dev"), null);
  long oneMinute = 60*1000;
  sampleRepo.write("file", "modified");
  sampleRepo.svnkit("commit", "--message=dev1", sampleRepo.wc());
  try (SCMFileSystem fs = SCMFileSystem.of(source, new SCMHead("branches/dev"), revision);) {			
    long lastModified = fs.lastModified();
    //ensure the timestamp is from after we started but not in the distant future
    assertThat(lastModified, greaterThanOrEqualTo(currentTime));
    assertThat(lastModified, lessThanOrEqualTo(currentTime + oneMinute));
    SCMFile file = fs.getRoot().child("file");
    lastModified = file.lastModified();
    assertThat(lastModified, greaterThanOrEqualTo(currentTime));
    assertThat(lastModified, lessThanOrEqualTo(currentTime + oneMinute));
  }
}
origin: org.jenkins-ci.plugins.workflow/workflow-multibranch

build.addAction(new SCMRevisionAction(tip));
SCMRevision rev = scmSource.getTrustedRevision(tip, listener);
try (SCMFileSystem fs = USE_HEAVYWEIGHT_CHECKOUT ? null : SCMFileSystem.of(scmSource, head, rev)) {
  if (fs != null) { // JENKINS-33273
    String script = null;
    try {
      script = fs.child(scriptPath).contentAsString();
      listener.getLogger().println("Obtained " + scriptPath + " from " + rev);
    } catch (IOException | InterruptedException x) {
origin: jenkinsci/subversion-plugin

sampleRepo.svnkit("commit", "--message=dev1", sampleRepo.wc());
SCMSource source = new SubversionSCMSource(null, sampleRepo.prjUrl());
try (SCMFileSystem fs = SCMFileSystem.of(source, new SCMHead("branches/dev"))) {
  assertThat(fs, notNullValue());
  assertThat(fs.getRoot(), notNullValue());
  Iterable<SCMFile> children = fs.getRoot().children();
  Iterator<SCMFile> iterator = children.iterator();
  assertThat(iterator.hasNext(), is(true));
origin: jenkinsci/workflow-cps-plugin

String expandedScriptPath = build.getEnvironment(listener).expand(scriptPath);
if (isLightweight()) {
  try (SCMFileSystem fs = SCMFileSystem.of(build.getParent(), scm)) {
    if (fs != null) {
      String script = fs.child(expandedScriptPath).contentAsString();
      listener.getLogger().println("Obtained " + expandedScriptPath + " from " + scm.getKey());
      Queue.Executable exec = owner.getExecutable();
origin: jenkinsci/subversion-plugin

sampleRepo.svnkit("commit", "--message=dev1", sampleRepo.wc());
SCMSource source = new SubversionSCMSource(null, sampleRepo.prjUrl());
try (SCMFileSystem fs = SCMFileSystem.of(source, new SCMHead("branches/dev"));) {
  assertThat(fs, notNullValue());
  assertThat(fs.getRoot(), notNullValue());
  Iterable<SCMFile> children = fs.getRoot().children();
  Set<String> names = new TreeSet<String>();
  SCMFile file = null;
origin: jenkinsci/subversion-plugin

@Override
public SubversionSCMSource.SCMRevisionImpl getRevision() {
  return (SCMRevisionImpl) super.getRevision();
}

origin: jenkinsci/workflow-multibranch-plugin

      try (SCMFileSystem fs = SCMBinder.USE_HEAVYWEIGHT_CHECKOUT ? null : SCMFileSystem.of(job, standaloneSCM)) {
        if (fs != null) { // JENKINS-33273
          try {
            String text = fs.child(step.path).contentAsString();
            listener.getLogger().println("Obtained " + step.path + " from " + standaloneSCM.getKey());
            return text;
String untrustedFile = null;
String content;
try (SCMFileSystem tipFS = trustCheck && !SCMBinder.USE_HEAVYWEIGHT_CHECKOUT ? SCMFileSystem.of(scmSource, head, tip) : null;
   SCMFileSystem trustedFS = SCMBinder.USE_HEAVYWEIGHT_CHECKOUT ? null : SCMFileSystem.of(scmSource, head, trusted)) {
  if (trustedFS != null && (!trustCheck || tipFS != null)) {
    if (trustCheck) {
      untrustedFile = tipFS.child(step.path).contentAsString();
    content = trustedFS.child(step.path).contentAsString();
    listener.getLogger().println("Obtained " + step.path + " from " + trusted);
  } else {
origin: jenkinsci/subversion-plugin

assertEquals(7, dev2);
SCMSource source = new SubversionSCMSource(null, sampleRepo.prjUrl());
try (SCMFileSystem fs = SCMFileSystem.of(source, new SCMHead("trunk"))) {
  assertThat(fs, notNullValue());
  SCMFile root = fs.getRoot();
  assertThat(root, notNullValue());
  assertTrue(root.isRoot());
origin: org.jenkins-ci.plugins.workflow/workflow-multibranch

      try (SCMFileSystem fs = SCMBinder.USE_HEAVYWEIGHT_CHECKOUT ? null : SCMFileSystem.of(job, standaloneSCM)) {
        if (fs != null) { // JENKINS-33273
          try {
            String text = fs.child(step.path).contentAsString();
            listener.getLogger().println("Obtained " + step.path + " from " + standaloneSCM.getKey());
            return text;
String untrustedFile = null;
String content;
try (SCMFileSystem tipFS = trustCheck && !SCMBinder.USE_HEAVYWEIGHT_CHECKOUT ? SCMFileSystem.of(scmSource, head, tip) : null;
   SCMFileSystem trustedFS = SCMBinder.USE_HEAVYWEIGHT_CHECKOUT ? null : SCMFileSystem.of(scmSource, head, trusted)) {
  if (trustedFS != null && (!trustCheck || tipFS != null)) {
    if (trustCheck) {
      untrustedFile = tipFS.child(step.path).contentAsString();
    content = trustedFS.child(step.path).contentAsString();
    listener.getLogger().println("Obtained " + step.path + " from " + trusted);
  } else {
jenkins.scm.apiSCMFileSystem

Most used methods

  • of
  • child
  • getRevision
  • getRoot
  • lastModified

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now