Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #11 from miniway/master

clear subdir list at remove
  • Loading branch information...
commit ba2d9326003a222a4eda3b8961af9df48ac15a24 2 parents 27b5bfb + 7097903
@hintjens hintjens authored
View
36 java/src/main/java/org/filemq/FmqClient.java
@@ -485,18 +485,18 @@ private void execute (Event event)
request.send (dealer);
request = new FmqMsg (0);
state = State.requesting_access_state;
- }
+ }
else
if (event == Event.srsly_event) {
logAccessDenied ();
terminateTheClient ();
state = State.start_state;
- }
+ }
else
if (event == Event.rtfm_event) {
logInvalidMessage ();
terminateTheClient ();
- }
+ }
else {
// Process all other events
logProtocolError ();
@@ -511,24 +511,24 @@ private void execute (Event event)
request.send (dealer);
request = new FmqMsg (0);
state = State.requesting_access_state;
- }
+ }
else
if (event == Event.ohai_ok_event) {
connectedToServer ();
getFirstSubscription ();
state = State.subscribing_state;
- }
+ }
else
if (event == Event.srsly_event) {
logAccessDenied ();
terminateTheClient ();
state = State.start_state;
- }
+ }
else
if (event == Event.rtfm_event) {
logInvalidMessage ();
terminateTheClient ();
- }
+ }
else {
// Process all other events
}
@@ -542,23 +542,23 @@ private void execute (Event event)
request = new FmqMsg (0);
getNextSubscription ();
state = State.subscribing_state;
- }
+ }
else
if (event == Event.finished_event) {
refillCreditAsNeeded ();
state = State.ready_state;
- }
+ }
else
if (event == Event.srsly_event) {
logAccessDenied ();
terminateTheClient ();
state = State.start_state;
- }
+ }
else
if (event == Event.rtfm_event) {
logInvalidMessage ();
terminateTheClient ();
- }
+ }
else {
// Process all other events
logProtocolError ();
@@ -570,40 +570,40 @@ private void execute (Event event)
if (event == Event.cheezburger_event) {
processThePatch ();
refillCreditAsNeeded ();
- }
+ }
else
if (event == Event.hugz_event) {
request.setId (FmqMsg.HUGZ_OK);
request.send (dealer);
request = new FmqMsg (0);
- }
+ }
else
if (event == Event.subscribe_event) {
formatIcanhazCommand ();
request.setId (FmqMsg.ICANHAZ);
request.send (dealer);
request = new FmqMsg (0);
- }
+ }
else
if (event == Event.send_credit_event) {
request.setId (FmqMsg.NOM);
request.send (dealer);
request = new FmqMsg (0);
- }
+ }
else
if (event == Event.icanhaz_ok_event) {
- }
+ }
else
if (event == Event.srsly_event) {
logAccessDenied ();
terminateTheClient ();
state = State.start_state;
- }
+ }
else
if (event == Event.rtfm_event) {
logInvalidMessage ();
terminateTheClient ();
- }
+ }
else {
// Process all other events
logProtocolError ();
View
12 java/src/main/java/org/filemq/FmqDir.java
@@ -99,6 +99,14 @@ public static FmqDir newFmqDir (final String path, final String parent)
return new FmqDir (dir);
}
+
+ public static FmqDir newFmqDir (final File dir)
+ {
+ if (!dir.exists ())
+ return null;
+
+ return new FmqDir (dir);
+ }
// --------------------------------------------------------------------------
// Destroy a directory item
@@ -195,10 +203,12 @@ public void remove (boolean force)
file.remove ();
file.destroy ();
}
+ files.clear ();
for (FmqDir dir : subdirs) {
dir.remove (force);
dir.destroy ();
}
+ subdirs.clear ();
size = 0;
count = 0;
}
@@ -288,7 +298,7 @@ public void dump (int indent)
ArrayList <FmqPatch> patches = new ArrayList <FmqPatch> ();
FmqFile [] old_files = flatten (older);
FmqFile [] new_files = flatten (newer);
-
+
int old_index = 0;
int new_index = 0;
View
5 java/src/main/java/org/filemq/FmqFile.java
@@ -54,6 +54,11 @@ public FmqFile (final String parent, final String name)
this (new File (parent, name));
}
+ public FmqFile (final File parent, final String name)
+ {
+ this (new File (parent, name));
+ }
+
public FmqFile (File path)
{
this.path = path;
View
2  model/client_java.gsl
@@ -409,7 +409,7 @@ long $(name)\
. endif
if (event == Event.$(name:c)_event) {
. output_event_body ()
- }
+ }
. endfor
. for event where name = "$other"
else {
Please sign in to comment.
Something went wrong with that request. Please try again.