Tabnine Logo
FilesystemConfig.getPath
Code IndexAdd Tabnine to your IDE (free)

How to use
getPath
method
in
com.emc.ecs.sync.config.storage.FilesystemConfig

Best Java code snippets using com.emc.ecs.sync.config.storage.FilesystemConfig.getPath (Showing top 7 results out of 315)

origin: EMCECS/ecs-sync

@Override
public String getIdentifier(String relativePath, boolean directory) {
  return createFile(config.getPath(), relativePath).getPath();
}
origin: EMCECS/ecs-sync

@Override
public String getRelativePath(String identifier, boolean directory) {
  String relativePath = createFile(identifier).getAbsolutePath();
  File rootFile = createFile(config.getPath());
  if (!config.isUseAbsolutePath() && relativePath.startsWith(rootFile.getAbsolutePath())) {
    relativePath = relativePath.substring(rootFile.getAbsolutePath().length());
  }
  if (File.separatorChar == '\\') {
    relativePath = relativePath.replace('\\', '/');
  }
  if (relativePath.startsWith("/")) {
    relativePath = relativePath.substring(1);
  }
  return relativePath;
}
origin: EMCECS/ecs-sync

@Override
public Iterable<ObjectSummary> allObjects() {
  ObjectSummary rootSummary = createSummary(config.getPath());
  if (rootSummary.isDirectory() && !config.isIncludeBaseDir()) return children(rootSummary);
  else return Collections.singletonList(rootSummary);
}
origin: EMCECS/ecs-sync

@Override
public void configure(SyncStorage source, Iterator<SyncFilter> filters, SyncStorage target) {
  super.configure(source, filters, target);
  File rootFile = createFile(config.getPath());
  if (source == this) {
    if (!rootFile.exists())
      throw new ConfigurationException("the source " + rootFile + " does not exist");
    if (config.getModifiedSince() != null) {
      modifiedSince = Iso8601Util.parse(config.getModifiedSince());
      if (modifiedSince == null) throw new ConfigurationException("could not parse modified-since");
    }
    if (config.getDeleteCheckScript() != null) {
      File deleteCheckScript = new File(config.getDeleteCheckScript());
      if (!deleteCheckScript.exists())
        throw new ConfigurationException("delete check script " + deleteCheckScript + " does not exist");
    }
    if (config.getExcludedPaths() != null) {
      excludedPathPatterns = new ArrayList<>();
      for (String pattern : config.getExcludedPaths()) {
        excludedPathPatterns.add(Pattern.compile(pattern));
      }
    }
  }
}
origin: EMCECS/ecs-sync

  @Test
  public void testFilesystemUriParsing() {
    FilesystemConfig fsConfig = new FilesystemConfig();

    String uri = "file:///foo/bar", path = "/foo/bar", newUri = "file:/foo/bar";
    ConfigUtil.parseUri(fsConfig, uri);
    Assert.assertEquals(path, fsConfig.getPath());
    Assert.assertEquals(newUri, ConfigUtil.generateUri(fsConfig));

    uri = "file://foo/bar";
    path = "foo/bar";
    newUri = "file:foo/bar";
    ConfigUtil.parseUri(fsConfig, uri);
    Assert.assertEquals(path, fsConfig.getPath());
    Assert.assertEquals(newUri, ConfigUtil.generateUri(fsConfig));
  }
}
origin: EMCECS/ecs-sync

@Test
public void testFilesystemCli() throws Exception {
  File sourceFile = new File("/tmp/foo");
  File targetFile = new File("/tmp/bar");
  String[] args = new String[]{
      "-source", "file://" + sourceFile,
      "-target", "file://" + targetFile,
      "--source-use-absolute-path",
      "--target-include-base-dir"
  };
  CliConfig cliConfig = CliHelper.parseCliConfig(args);
  SyncConfig syncConfig = CliHelper.parseSyncConfig(cliConfig, args);
  Object source = syncConfig.getSource();
  Assert.assertNotNull("source is null", source);
  Assert.assertTrue("source is not FilesystemSource", source instanceof FilesystemConfig);
  FilesystemConfig fsSource = (FilesystemConfig) source;
  Object target = syncConfig.getTarget();
  Assert.assertNotNull("target is null", target);
  Assert.assertTrue("target is not FilesystemTarget", target instanceof FilesystemConfig);
  FilesystemConfig fsTarget = (FilesystemConfig) target;
  Assert.assertEquals("source file mismatch", sourceFile.getPath(), fsSource.getPath());
  Assert.assertTrue("source use-absolute-path should be enabled", fsSource.isUseAbsolutePath());
  Assert.assertEquals("target file mismatch", targetFile.getPath(), fsTarget.getPath());
  Assert.assertTrue("target include-base-dir should be enabled", fsTarget.isIncludeBaseDir());
}
origin: EMCECS/ecs-sync

FilesystemConfig xObject = (FilesystemConfig) unmarshaller.unmarshal(new StringReader(xml));
Assert.assertEquals(object.getPath(), xObject.getPath());
Assert.assertEquals(object.isUseAbsolutePath(), xObject.isUseAbsolutePath());
Assert.assertEquals(object.isFollowLinks(), xObject.isFollowLinks());
com.emc.ecs.sync.config.storageFilesystemConfiggetPath

Popular methods of FilesystemConfig

  • <init>
  • isUseAbsolutePath
  • setPath
  • getDeleteCheckScript
  • getDeleteOlderThan
  • getExcludedPaths
  • getModifiedSince
  • isFollowLinks
  • isIncludeBaseDir
  • setExcludedPaths
  • setModifiedSince
    Date/time should be provided in ISO-8601 UTC format (i.e. 2015-01-01T04:30:00Z)
  • setStoreMetadata
  • setModifiedSince,
  • setStoreMetadata,
  • isStoreMetadata,
  • setDeleteCheckScript,
  • setDeleteOlderThan,
  • setFollowLinks,
  • setUseAbsolutePath

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JFileChooser (javax.swing)
  • Top Sublime Text 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