Package net.sourceforge.fullsync.fs.buffering

Examples of net.sourceforge.fullsync.fs.buffering.BufferedFile


    if (!buffered.isBuffered()) {
      return new State(State.NodeInSync, buffered.exists() ? Location.Both : Location.None);
    }

    File source = buffered.getUnbuffered();
    BufferedFile destination = (BufferedFile) buffered;

    if (!source.exists()) {
      if (!destination.exists()) {
        return new State(State.NodeInSync, Location.None);
      }
      else {
        return new State(State.Orphan, Location.Destination);
      }
    }
    else if (!destination.exists()) {
      return new State(State.Orphan, Location.Source);
    }

    if (source.isDirectory()) {
      if (destination.isDirectory()) {
        return new State(State.NodeInSync, Location.Both);
      }
      else {
        return new State(State.DirHereFileThere, Location.Source);
      }
    }
    else if (destination.isDirectory()) {
      return new State(State.DirHereFileThere, Location.Destination);
    }

    return comparer.compareFiles(source, destination);
  }
View Full Code Here


  public File createChild(File dir, String name, boolean directory) throws IOException {
    File n = dir.getUnbuffered().getChild(name);
    if (n == null) {
      n = dir.getUnbuffered().createChild(name, directory);
    }
    BufferedFile bf = new AbstractBufferedFile(this, n, dir, directory, false);
    return bf;
  }
View Full Code Here

  protected void updateFromFileSystem(BufferedFile buffered) throws IOException {
    // load fs entries if wanted
    Collection<File> fsChildren = buffered.getUnbuffered().getChildren();
    for (File uf : fsChildren) {
      BufferedFile bf = (BufferedFile) buffered.getChild(uf.getName());
      if (bf == null) {
        bf = new AbstractBufferedFile(this, uf, root, uf.isDirectory(), false);
        buffered.addChild(bf);
      }
      if (bf.isDirectory()) {
        updateFromFileSystem(bf);
      }
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.fullsync.fs.buffering.BufferedFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.