Package ef.impl.response

Examples of ef.impl.response.MapResponse


    @Override
    public Response execute(TreeRequest request) {
        Volume volume = volumeManager.getRequiredVolume(request.target);
        List<FileEntry> list = volume.tree (request.target);
        MapResponse response = new MapResponse();
        response.put("tree", list);
        return response;
    }
View Full Code Here


    @Override
    public Response execute(ArchiveRequest request) {
        Volume volume = volumeManager.getRequiredVolume(request.targets[0]);
        FileEntry entry = volume.archive(request.type, request.targets);
        MapResponse response = new MapResponse();
        response.put("added", Arrays.asList(entry));
        return response;
    }
View Full Code Here

    @Override
    public Response execute(MkDirRequest request) {
        Volume volume = volumeManager.getRequiredVolume(request.target);
        FileEntry entry = volume.mkDir(request.target, request.name);
        MapResponse response = new MapResponse();
        response.put("added", Arrays.asList(entry));
        return response;
    }
View Full Code Here

        for(String target: request.targets){
            volume.remove(target);
        }

        MapResponse response = new MapResponse();
        response.put("removed", request.targets);
        return response;
    }
View Full Code Here

    @Override
    public Response execute(ParentsRequest request) {
        Volume volume = volumeManager.getRequiredVolume(request.target);
        List<FileEntry> list = volume.parents(request.target);
        MapResponse response = new MapResponse();

        for(Volume vol: volumeManager.getVolumes()){
            list.add(vol.root());
        }

        response.put("tree", list);
        return response;
    }
View Full Code Here

    @Override
    public Response execute(GetRequest request) {
        Volume volume = volumeManager.getRequiredVolume(request.target);
        String content = volume.readText(request.target);
        MapResponse response = new MapResponse();
        response.put("content", content);
        return response;
    }
View Full Code Here

            case CROP: entry = volume.cropImage(request.target, request.width, request.height, request.x, request.y); break;
            default:
                throw new ErrException(Error.errUnknown);
        }

        MapResponse response = new MapResponse();
        response.put("changed", Arrays.asList(entry));
        return response;
    }
View Full Code Here

                    } catch (IOException ignored) {}
                }
            }
        }

        MapResponse response = new MapResponse();
        response.put("added", added);
        if(!errorData.isEmpty()){
            response.put("error", "Some files was not uploaded");
            response.put("errorData", errorData);
        }

        return response;
    }
View Full Code Here

    @Override
    public Response execute(RenameRequest request) {
        Volume volume = volumeManager.getRequiredVolume(request.target);
        FileEntry entry = volume.rename(request.target, request.name);
        MapResponse response = new MapResponse();
        response.put("removed", Arrays.asList(request.target));
        response.put("added", Arrays.asList(entry));
        return response;
    }
View Full Code Here

    @Override
    public Response execute(MkFileRequest request) {
        Volume volume = volumeManager.getRequiredVolume(request.target);
        FileEntry entry = volume.mkFile(request.target, request.name);
        MapResponse response = new MapResponse();
        response.put("added", Arrays.asList(entry));
        return response;
    }
View Full Code Here

TOP

Related Classes of ef.impl.response.MapResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.