import java.util.logging.Level;
import java.util.logging.Logger;
+import net.pterodactylus.fcp.highlevel.GetRequestResult;
import net.pterodactylus.fcp.highlevel.HighLevelCallback;
import net.pterodactylus.fcp.highlevel.HighLevelCallbackListener;
import net.pterodactylus.fcp.highlevel.HighLevelClient;
import net.pterodactylus.fcp.highlevel.HighLevelProgress;
import net.pterodactylus.fcp.highlevel.HighLevelProgressListener;
+import net.pterodactylus.fcp.highlevel.PutDirRequestResult;
+import net.pterodactylus.fcp.highlevel.PutRequestResult;
import net.pterodactylus.fcp.highlevel.RequestListResult;
import net.pterodactylus.fcp.highlevel.RequestResult;
+import net.pterodactylus.jsite.core.Request.Type;
import net.pterodactylus.util.logging.Logging;
/**
for (RequestResult requestResult: requestListResult) {
String identifier = requestResult.getIdentifier();
logger.log(Level.FINER, "got identifier: " + identifier);
+ Request request = identifierRequests.get(identifier);
+ if (request == null) {
+ request = new Request(node, identifier);
+ }
+ if (request.getType() == null) {
+ if (requestResult instanceof GetRequestResult) {
+ request.setType(Type.get);
+ } else if (requestResult instanceof PutRequestResult) {
+ request.setType(Type.put);
+ } else if (requestResult instanceof PutDirRequestResult) {
+ request.setType(Type.putDir);
+ }
+ }
if (identifierRequests.containsKey(identifier)) {
continue;
}
- Request request = new Request(node, identifier);
identifierRequests.put(requestResult.getIdentifier(), request);
- /* TODO - fill request */
fireRequestAdded(request);
}
}