|
|
@ -10,34 +10,26 @@ public class SyncFile extends File {
|
|
|
|
public long timeModifiedFromStateFile = 0;
|
|
|
|
public long timeModifiedFromStateFile = 0;
|
|
|
|
|
|
|
|
|
|
|
|
public String relativePath;
|
|
|
|
public String relativePath;
|
|
|
|
private SyncDirectory sd;
|
|
|
|
private final SyncDirectory sd;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public SyncFile(SyncDirectory sd, String pathname) {
|
|
|
|
|
|
|
|
|
|
|
|
public SyncFile(SyncDirectory sd , String pathname) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
super(pathname);
|
|
|
|
super(pathname);
|
|
|
|
this.sd = sd;
|
|
|
|
this.sd = sd;
|
|
|
|
relativePath = this.getPath().replace(sd.path, "");
|
|
|
|
relativePath = this.getPath().replace(sd.path, "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setTimeModifiedFromStateFile(long value) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setTimeModifiedFromStateFile(long value){
|
|
|
|
|
|
|
|
timeModifiedFromStateFile = value;
|
|
|
|
timeModifiedFromStateFile = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public long getTimeModifiedFromStateFile() {
|
|
|
|
public long getTimeModifiedFromStateFile(){
|
|
|
|
|
|
|
|
SyncFile record = sd.readStateFile().get(this.getPath());
|
|
|
|
SyncFile record = sd.readStateFile().get(this.getPath());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return record == null ? 0 : record.timeModifiedFromStateFile;
|
|
|
|
return record == null ? 0 : record.timeModifiedFromStateFile;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* If File exists on Disk get the TimeModified from there.
|
|
|
|
* If File exists on Disk get the TimeModified from there.
|
|
|
|
* Else try to read it from StateFile.
|
|
|
|
* Else try to read it from StateFile.
|
|
|
@ -54,10 +46,6 @@ public class SyncFile extends File {
|
|
|
|
if (sd.readStateFile().get(this.getPath())!=null){
|
|
|
|
if (sd.readStateFile().get(this.getPath())!=null){
|
|
|
|
return getTimeModifiedFromStateFile();
|
|
|
|
return getTimeModifiedFromStateFile();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|