Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0ff4872 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

add getter and setter to SynchronizableFileInfo

parent 0369a26d
Loading
Loading
Loading
Loading
+19 −8
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ import android.util.Log;
import com.owncloud.android.lib.resources.files.FileUtils;

import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -15,8 +14,6 @@ import java.io.InputStream;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;


/**
@@ -32,16 +29,14 @@ public class SynchronizableFileInfo implements ISynchronizableContent {
    private boolean isFolder;

    public SynchronizableFileInfo(@NonNull File file) {

        try {

        this.isFolder = file.isDirectory();
        this.lastModified = file.lastModified();
        this.hash = file.lastModified()+"";
        try {
            this.localPath = file.getCanonicalPath();
            if(file.isDirectory()){
                this.localPath+= FileUtils.PATH_SEPARATOR;
            }
            this.isFolder = file.isDirectory();
            this.lastModified = file.lastModified();
        }catch (Exception e){
            Log.e(TAG, e.toString());
            //@TODO: dunno what to do here...
@@ -138,4 +133,20 @@ public class SynchronizableFileInfo implements ISynchronizableContent {
            }
        }return null;
    }

    public void setHash(String hash) {
        this.hash = hash;
    }

    public void setLocalPath(String localPath) {
        this.localPath = localPath;
    }

    public void setLastModified(long lastModified) {
        this.lastModified = lastModified;
    }

    public void setFolder(boolean folder) {
        isFolder = folder;
    }
}