Source code: com/flexstor/remote/resourcefork/ntfs/NtfsForkServer.java
1 /*
2 * NtfsForkServer.java
3 *
4 * Copyright $Date: 2003/08/11 03:53:52 $ FLEXSTOR.net Inc.
5 *
6 * This work is licensed for use and distribution under license terms found at
7 * http://www.flexstor.org/license.html
8 *
9 */
10
11 package com.flexstor.remote.resourcefork.ntfs;
12
13 import java.rmi.RemoteException;
14 import java.rmi.server.UnicastRemoteObject;
15
16 import com.flexstor.common.services.remote.resourcefork.RsrcForkServerI;
17
18 /**
19 * Server side implementation for requesting resource fork operations to files residing in a NTFS system.
20 */
21 public class NtfsForkServer
22 extends UnicastRemoteObject
23 implements RsrcForkServerI
24 {
25 final static String IDENTIFIER = "$Id: NtfsForkServer.java,v 1.3 2003/08/11 03:53:52 aleric Exp $";
26
27 public NtfsForkServer()
28 throws RemoteException
29 {
30 }
31
32 /**
33 * Creates a MacBinary file in the remote server
34 *
35 * @param sInFile Source file for creating MacBinary, must be local to the remote server.
36 * @param sLocation Destination for the MacBinary, must be local to the remote server.
37 * @return boolean indicating success or failure
38 */
39 public boolean encodeMacBinary( String sInFile, String sDestination )
40 throws RemoteException
41 {
42 System.out.println( "encodeMacBinary from: " + sInFile + " to " + sDestination );
43 try
44 {
45 return (new NtfsForkServerThread()).encodeMacBinary( sInFile, sDestination );
46 }
47 catch( RemoteException re )
48 {
49 throw re;
50 }
51 catch ( Exception e )
52 {
53 throw new RemoteException( "", e );
54 }
55 }
56
57 /**
58 * Splits a MacBinary file in the remote server
59 *
60 * @param sInFile MacBinary source file, must be local to the remote server.
61 * @param sLocation Destination for the data and resource fork, must be local to the remote server.
62 * @return boolean indicating success or failure
63 */
64 public boolean decodeMacBinary( String sInFile, String sDestination )
65 throws RemoteException
66 {
67 System.out.println( "decodeMacBinary from: " + sInFile + " to " + sDestination );
68 try
69 {
70 return (new NtfsForkServerThread()).decodeMacBinary( sInFile, sDestination );
71 }
72 catch( RemoteException re )
73 {
74 throw re;
75 }
76 catch ( Exception e )
77 {
78 throw new RemoteException( "", e );
79 }
80 }
81
82 /**
83 * Copies a file from one location to another, both location in the remote server
84 *
85 * @param sInFile Source file, must be local to the remote server.
86 * @param sLocation Destination, must be local to the remote server.
87 * @return boolean indicating success or failure
88 */
89 public boolean copyFile( String sInFile, String sDestination )
90 throws RemoteException
91 {
92 System.out.println( "copy from: " + sInFile + " to " + sDestination );
93 try
94 {
95 return (new NtfsForkServerThread()).copyFile( sInFile, sDestination );
96 }
97 catch( RemoteException re )
98 {
99 throw re;
100 }
101 catch ( Exception e )
102 {
103 throw new RemoteException( "", e );
104 }
105 }
106
107 /**
108 * Moves a file from one location to another, both location in the remote server
109 *
110 * @param sInFile Source file, must be local to the remote server.
111 * @param sLocation Destination, must be local to the remote server.
112 * @return boolean indicating success or failure
113 */
114 public boolean moveFile( String sInFile, String sDestination )
115 throws RemoteException
116 {
117 System.out.println( "move from: " + sInFile + " to " + sDestination );
118 try
119 {
120 return (new NtfsForkServerThread()).moveFile( sInFile, sDestination );
121 }
122 catch( RemoteException re )
123 {
124 throw re;
125 }
126 catch ( Exception e )
127 {
128 throw new RemoteException( "", e );
129 }
130 }
131
132 /**
133 * Deletes a file in the remote server
134 *
135 * @param sInFile Source file to delete, must be local to the remote server.
136 * @return boolean indicating success or failure
137 */
138 public boolean deleteFile( String sInFile )
139 throws RemoteException
140 {
141 System.out.println( "delete from: " + sInFile );
142 try
143 {
144 return (new NtfsForkServerThread()).deleteFile( sInFile );
145 }
146 catch( RemoteException re )
147 {
148 throw re;
149 }
150 catch ( Exception e )
151 {
152 throw new RemoteException( "", e );
153 }
154 }
155 }