1 | package fr.alcatel.ether.app.common; |
---|
2 | |
---|
3 | // JDK - io |
---|
4 | import java.io.IOException; |
---|
5 | import java.io.FileNotFoundException; |
---|
6 | import java.io.File; |
---|
7 | // JDK - collections |
---|
8 | import java.util.ArrayList; |
---|
9 | // JDK - rmi |
---|
10 | import java.rmi.Remote; |
---|
11 | import java.rmi.RemoteException; |
---|
12 | |
---|
13 | public interface RemoteFileManager extends Remote { |
---|
14 | |
---|
15 | /** RMI registration name of our remote file manager */ |
---|
16 | public static final String IF_REMOTE_FILE_MANAGER = "RemoteFileManager"; |
---|
17 | |
---|
18 | /** open a remote file for reading or writing */ |
---|
19 | void open( RemoteFile f ) throws RemoteException, IOException, FileNotFoundException; |
---|
20 | /** close a remote file after reading or writing */ |
---|
21 | void close( RemoteFile f ) throws RemoteException, IOException; |
---|
22 | /** read bytes from a remote file */ |
---|
23 | byte[] read( RemoteFile f ) throws RemoteException, IOException; |
---|
24 | /** copy a remote file from source to destination */ |
---|
25 | boolean copy( RemoteFile src, RemoteFile dest ) throws RemoteException; |
---|
26 | /** delete a remote file */ |
---|
27 | boolean delete( RemoteFile file ) throws RemoteException; |
---|
28 | /** transférer a remote file from source to destination */ |
---|
29 | boolean move( RemoteFile src, RemoteFile dest ) throws RemoteException; |
---|
30 | /** créer un répertoire distant */ |
---|
31 | boolean makeDir( RemoteFile file ) throws RemoteException; |
---|
32 | /** delete a remote directory */ |
---|
33 | boolean deleteDir( RemoteFile directory ) throws RemoteException; |
---|
34 | /** lister les fichiers distants d'un répertoire d'un hôte */ |
---|
35 | ArrayList list( RemoteFile directory ) throws RemoteException; |
---|
36 | /** déterminer la taille des fichiers distants d'un répertoire d'un hôte */ |
---|
37 | long size( RemoteFile directory ) throws RemoteException; |
---|
38 | /** déterminer si un fichier distant existe */ |
---|
39 | boolean exists( RemoteFile file ) throws RemoteException; |
---|
40 | /** retrieve a remote file on local */ |
---|
41 | File retrieve( RemoteFile remoteFile ) throws RemoteException; |
---|
42 | /** Retrieves the local file corresponding a remote file on local - null if file is not available with this remote file manager */ |
---|
43 | File getLocalFile( RemoteFile remoteFile ) throws RemoteException, IOException; |
---|
44 | /** Supprimer le répertoire utlisée pour stocker les fichiers désarchivés */ |
---|
45 | void cleanTmpDir(int orderId) throws RemoteException; |
---|
46 | |
---|
47 | } |
---|
48 | |
---|