- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 42 of file WorkFile.java.
◆ checkExisting()
boolean org.turro.wd.files.WorkFile.checkExisting |
( |
| ) |
|
◆ compareTo()
int org.turro.wd.files.WorkFile.compareTo |
( |
WorkFile |
o | ) |
|
◆ doDownload()
void org.turro.wd.files.WorkFile.doDownload |
( |
int |
updateAction | ) |
|
Definition at line 196 of file WorkFile.java.
198 if((updateAction == SyncTask.UPDATE_DO_NOTHING) ||
199 (!
isDownloadable()) && !(updateAction == SyncTask.UPDATE_UPDATE_FOR_EDITING))
return;
200 GetQuery getQuery =
new GetQuery(
202 parent.
getContext() +
"/pservice/download",
false);
203 getQuery.getParameters().put(
"user", parent.
getUser());
204 getQuery.getParameters().put(
"forEditing",
205 (updateAction == SyncTask.UPDATE_UPDATE_FOR_EDITING) ?
"true" :
"false");
207 getQuery.getParameters().put(
"fileName",
getName());
208 getQuery.setSerializer(
new FileSerializer());
209 File receivedFile = (File) getQuery.execute();
212 OutputStream os =
new FileOutputStream(saveFile);
213 ((FileSerializer) getQuery.getSerializer())
214 .writeObject(receivedFile, os);
216 saveFile.setLastModified(downModification.getTime());
217 }
catch (ParseException ex) {
218 Logger.getLogger(WorkFile.class.getName()).log(Level.SEVERE,
null, ex);
219 }
catch (IOException ex) {
220 Logger.getLogger(WorkFile.class.getName()).log(Level.SEVERE,
null, ex);
221 }
catch (SerializationException ex) {
222 Logger.getLogger(WorkFile.class.getName()).log(Level.SEVERE,
null, ex);
223 }
catch (QueryException ex) {
224 Logger.getLogger(WorkFile.class.getName()).log(Level.SEVERE,
null, ex);
◆ doUnlock()
void org.turro.wd.files.WorkFile.doUnlock |
( |
| ) |
|
Definition at line 228 of file WorkFile.java.
230 GetQuery getQuery =
new GetQuery(
232 parent.
getContext() +
"/pservice/unlock",
false);
233 getQuery.getParameters().put(
"user", parent.
getUser());
235 getQuery.getParameters().put(
"fileName",
getName());
236 getQuery.setSerializer(
new BinarySerializer());
238 }
catch (QueryException ex) {
239 Logger.getLogger(Directory.class.getName()).log(Level.SEVERE,
null, ex);
◆ doUpload()
void org.turro.wd.files.WorkFile.doUpload |
( |
String |
comment, |
|
|
int |
commitAction |
|
) |
| |
Definition at line 173 of file WorkFile.java.
175 if((commitAction == SyncTask.COMMIT_DO_NOTHING) || !
isUploadable())
return;
176 PostQuery postQuery =
new PostQuery(
178 parent.
getContext() +
"/pservice/upload",
false);
179 postQuery.getParameters().put(
"user", parent.
getUser());
181 postQuery.getParameters().put(
"fileName",
getName());
182 postQuery.getParameters().put(
"fileDate", WdFormats.format(file.lastModified()));
183 postQuery.getParameters().put(
"comment", comment);
184 postQuery.getParameters().put(
"lock",
185 (((commitAction == SyncTask.COMMIT_KEEP_LOCK) &&
isServerLocked()) ?
"true" :
"false"));
186 postQuery.setSerializer(
new FileSerializer());
187 postQuery.setValue(file);
189 }
catch (ParseException ex) {
190 Logger.getLogger(WorkFile.class.getName()).log(Level.SEVERE,
null, ex);
191 }
catch (QueryException ex) {
192 Logger.getLogger(WorkFile.class.getName()).log(Level.SEVERE,
null, ex);
◆ getDownModification()
Date org.turro.wd.files.WorkFile.getDownModification |
( |
| ) |
|
◆ getFile()
File org.turro.wd.files.WorkFile.getFile |
( |
| ) |
|
◆ getName()
String org.turro.wd.files.WorkFile.getName |
( |
| ) |
|
◆ getParent()
Directory org.turro.wd.files.WorkFile.getParent |
( |
| ) |
|
◆ getServerLocker()
String org.turro.wd.files.WorkFile.getServerLocker |
( |
| ) |
|
◆ getServerOwner()
String org.turro.wd.files.WorkFile.getServerOwner |
( |
| ) |
|
◆ getServerOwnerName()
String org.turro.wd.files.WorkFile.getServerOwnerName |
( |
| ) |
|
◆ getServerSize()
long org.turro.wd.files.WorkFile.getServerSize |
( |
| ) |
|
◆ getSystemFile()
File org.turro.wd.files.WorkFile.getSystemFile |
( |
| ) |
|
◆ getSystemName()
String org.turro.wd.files.WorkFile.getSystemName |
( |
| ) |
|
◆ getSystemPath()
String org.turro.wd.files.WorkFile.getSystemPath |
( |
| ) |
|
◆ isDownloadable()
boolean org.turro.wd.files.WorkFile.isDownloadable |
( |
| ) |
throws ParseException |
Definition at line 139 of file WorkFile.java.
141 WdFormats.before(downModification, file.lastModified()))) &&
Date getDownModification()
◆ isExistsOnServer()
boolean org.turro.wd.files.WorkFile.isExistsOnServer |
( |
| ) |
|
◆ isServerLocked()
boolean org.turro.wd.files.WorkFile.isServerLocked |
( |
| ) |
|
◆ isUploadable()
boolean org.turro.wd.files.WorkFile.isUploadable |
( |
| ) |
throws ParseException |
Definition at line 145 of file WorkFile.java.
147 WdFormats.after(downModification, file.lastModified()))) &&
◆ readXML()
void org.turro.wd.files.WorkFile.readXML |
( |
Element |
root | ) |
throws ParseException |
Definition at line 151 of file WorkFile.java.
152 if(root.getAttributeValue(
"name") !=
null)
153 setName(root.getAttributeValue(
"name"));
void setName(String name)
◆ setDownModification()
void org.turro.wd.files.WorkFile.setDownModification |
( |
Date |
downModification | ) |
|
Definition at line 55 of file WorkFile.java.
56 this.downModification = downModification;
◆ setFile()
void org.turro.wd.files.WorkFile.setFile |
( |
File |
file | ) |
|
◆ setName()
void org.turro.wd.files.WorkFile.setName |
( |
String |
name | ) |
|
◆ setParent()
void org.turro.wd.files.WorkFile.setParent |
( |
Directory |
parent | ) |
|
◆ setServerLocked()
void org.turro.wd.files.WorkFile.setServerLocked |
( |
boolean |
serverLocked | ) |
|
Definition at line 87 of file WorkFile.java.
88 this.serverLocked = serverLocked;
◆ setServerLocker()
void org.turro.wd.files.WorkFile.setServerLocker |
( |
String |
serverLocker | ) |
|
Definition at line 95 of file WorkFile.java.
96 this.serverLocker = serverLocker;
◆ setServerOwner()
void org.turro.wd.files.WorkFile.setServerOwner |
( |
String |
serverOwner | ) |
|
Definition at line 103 of file WorkFile.java.
104 this.serverOwner = serverOwner;
◆ setServerOwnerName()
void org.turro.wd.files.WorkFile.setServerOwnerName |
( |
String |
serverOwnerName | ) |
|
Definition at line 111 of file WorkFile.java.
112 this.serverOwnerName = serverOwnerName;
◆ setServerSize()
void org.turro.wd.files.WorkFile.setServerSize |
( |
long |
serverSize | ) |
|
◆ writeXML()
void org.turro.wd.files.WorkFile.writeXML |
( |
Element |
root | ) |
|
Definition at line 156 of file WorkFile.java.
157 Element el =
new Element(
"wfile");
158 el.setAttribute(
"name",
getName());
The documentation for this class was generated from the following file: