package be.iminds.ilabt.jfed.util.tmp_file_helpers;

import org.slf4j.LoggerFactory;

import java.io.File;

/**
* RealFileHelper looks just like a TmpFileHelper, but it is in fact a file that already exists and needs to continue to be stored permanently.
 * So it may not be deleted like a TmpFile
*/
public class PermanentFile implements TmpFile {
    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(PermanentFile.class);

    private final File realFile;

    public PermanentFile(File realFile) {
        this.realFile = realFile;
    }

    @Override
    public void store() { }

    @Override
    public void delete() { }

    @Override
    public File getFile() {
        return realFile;
    }

    @Override
    public File getDir() {
        return realFile.getParentFile();
    }

    @Override
    public String getFilename() {
        return realFile.getPath();
    }
}
