litesoft
@ 939
litesoft / trunk / Java / core / Server / src / org / litesoft / textfiledirectory / TextFileDirectory.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
package org.litesoft.textfiledirectory; import org.litesoft.commonfoundation.annotations.*; import org.litesoft.core.simpletypes.*; public interface TextFileDirectory { public class FileAlreadyExists extends TextFileDirectoryException { public FileAlreadyExists( String message ) { super( message ); } } public class FileDoesNotExists extends TextFileDirectoryException { public FileDoesNotExists( String message ) { super( message ); } } /** * Return the Directory path <i>behind</i> this TextFileDirectory. */ String getDirectoryPath(); /** * Return if the Directory represented by this instance currently exists. */ boolean exists(); /** * Get the list of File Names that have the extension(s) indicated by <code>pExtensions</code>, no extensions means all files. * * @param pExtensions of the files of interest without the '.', e.g. "txt" or "java" (the extension is case sensitive). * * @return Non Null String array (may be an empty array) of the file names (with the extensions) found. */ @NotNull String[] getFiles( String... pExtensions ); TextFile load( @NotNull String pFileName ) throws FileDoesNotExists; void create( @NotNull TextFile pFile ) throws FileAlreadyExists; void update( @NotNull TextFile pFile ) throws FileDoesNotExists; void delete( @NotNull TextFile pFile ) throws FileDoesNotExists; void delete( @NotNull String pFileName ) throws FileDoesNotExists; } |