Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package de.pfabulist.lindwurm.stellvertreter;
  
  
  
 import java.util.Date;
 import java.util.UUID;
 
 import static com.esotericsoftware.kryo.serializers.TaggedFieldSerializer.Tag;

** BEGIN LICENSE BLOCK ***** BSD License (2 clause) Copyright (c) 2006 - 2014, Stephan Pfab All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Stephan Pfab BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **** END LICENSE BLOCK ****
 
 public class FileMeta{
 
     @Tag(0) private UUID uuid;
     @Tag(1) private long lastModifiedTime;
     @Tag(2) private long size;
     @Tag(3) private String name;
     @Tag(4) private boolean isDir;
     @Tag(5) private long lastSyncTime;
     @Tag(6) private long lastAccessTime;
     @Tag(7) private boolean pinned;
     @Tag(8) private boolean elseUptodate;
 
     private FileMetaString nameboolean isDir) {
          = new Date().getTime();
          = 0;
          = UUID.randomUUID();
         this. = name;
         this. = isDir;
         this. = false;
     }
 
     public static FileMeta createDirString name ) {
         return new FileMetanametrue );
     }
 
     public static FileMeta createFileString name ) {
         return new FileMetanamefalse );
     }
 
 
     public FileMeta(){}
 
     public void serializeKryo kryoOutputStream stream ) {
 
         try ( Output output = new Output(stream)) {
             kryo.writeObject(outputthis);
         }
     }
 
     public static FileMeta valueOfKryo kryo,  InputStream stream ) {
         try ( Input input = new Input(stream)) {
             return kryo.readObject(inputFileMeta.class);
         }
     }
 
     public FileTime getLastModifiedFileTime() {
         return FileTime.fromMillis();
     }
 
     public boolean isDir() {
         return ;
     }
 
     public long getSize() {
         return ;
     }
 
     public UUID getUUID() {
        return ;
    }
    public void setSize(long size) {
        this. = size;
    }
    public void setLastModifiedTime(FileTime lastModifiedTime) {
        this. = lastModifiedTime.toMillis();
    }
    public void setSyncTimeNow() {
         = System.currentTimeMillis();
    }
    public void setLastAccessTime(FileTime lastAccessTime) {
        this. = lastAccessTime.toMillis();
    }
    public FileTime getLastAccessTime() {
        return FileTime.fromMillis();
    }
    public FileTime getLastSyncTime() {
        return FileTime.fromMillis();
    }
    public boolean getPinned() {
        return ;
    }
    public void setPinned(boolean pinned) {
        this. = pinned;
    }
    public boolean isElseUptodate() {
        return ;
    }
    public void setElseUptodate(boolean elseUptodate) {
        this. = elseUptodate;
    }
New to GrepCode? Check out our FAQ X