Tabnine Logo
SCMFile.lastModified
Code IndexAdd Tabnine to your IDE (free)

How to use
lastModified
method
in
jenkins.scm.api.SCMFile

Best Java code snippets using jenkins.scm.api.SCMFile.lastModified (Showing top 2 results out of 315)

origin: jenkinsci/subversion-plugin

@Override
public long lastModified() throws IOException, InterruptedException {
  return getRoot().lastModified();
}
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));
  }
}
jenkins.scm.apiSCMFilelastModified

Popular methods of SCMFile

  • contentAsString
  • child
  • children
  • getName
  • getType
  • isRoot

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best IntelliJ plugins
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