001 package jmaster.jumploader.model.api.file;
002
003 import jmaster.jumploader.model.api.common.IAttributeSet;
004
005 /**
006 * IFile
007 *
008 * @author timur
009 */
010
011 public interface IFile {
012 //---------------------------------------------------------------
013 // constants
014 //---------------------------------------------------------------
015 //---------------------------------------------------------------
016 // business methods
017 //---------------------------------------------------------------
018 /**
019 * file id retrieval (convinience method)
020 */
021 public String getId();
022 /**
023 * id assignment
024 */
025 public void setId( String id );
026 /**
027 * file handle retrieval
028 */
029 public java.io.File getFile();
030 /**
031 * local file path retrieval
032 */
033 public String getPath();
034 /**
035 * local file name retrieval
036 */
037 public String getName();
038 /**
039 * file length retrieval (bytes)
040 */
041 public long getLength();
042 /**
043 * shows whether file is directory
044 */
045 public boolean isDirectory();
046 /**
047 * shows whether file is normal file
048 */
049 public boolean isFile();
050 /**
051 * shows whether file belongs to filesystem or not
052 */
053 public boolean isFileSystem();
054 /**
055 * shows whether file is drive
056 */
057 public boolean isDrive();
058 /**
059 * attribute set retrieval
060 */
061 public IAttributeSet getAttributeSet();
062 /**
063 * oroginal file path retrieval,
064 * used when original file replaced with transformed (i.e. zipped)
065 */
066 public String getOriginalFilePath();
067 /**
068 * compression ratio (transformed file length / original file length)
069 */
070 public Double getCompressionRatio();
071 /**
072 * retrieve file mime type
073 */
074 public String getMimeType();
075 /**
076 * check whether file is hidden
077 */
078 public boolean isHidden();
079 /**
080 * general purpose checked flag retrieval
081 */
082 public boolean isChecked();
083 /**
084 * general purpose checked flag assignment
085 */
086 public void setChecked( boolean checked );
087 /**
088 * check whether check update enabled
089 */
090 public boolean isCheckedUpdatable();
091 /**
092 * set whether check update enabled
093 */
094 public void setCheckedUpdatable( boolean updatable );
095 }