Package com.infoclinika.mssharing.fileserver.model

Examples of com.infoclinika.mssharing.fileserver.model.NodePath


    private FileStorageService storageService;


    @Test(enabled = false)
    public void testGetNonExistingFile() {
        final NodePath randomPath = new NodePath("non-existing-node-path" + System.currentTimeMillis());
        final StoredFile file = storageService.get(randomPath);
        assertNull(file, "File obtained at random path expected to be NULL, but it is not.");
    }
View Full Code Here


        final File file = new File(tempDir, filename);
        try {
            Files.touch(file);
            Files.write("My test file contents".getBytes(), file);

            final NodePath nodePath = new NodePath("myuser/" + filename);
            final StoredFile storedFile = new StoredFile(new BufferedInputStream(new FileInputStream(file)));
            storageService.put(nodePath, storedFile);

            final StoredFile obtainedFile = storageService.get(nodePath);
            assertNotNull(obtainedFile, "Obtained file must not be NULL at path " + nodePath);
View Full Code Here

        for (DashboardReader.FileLine fileLine : filesToDownload) {
            totalSizeInBytes = totalSizeInBytes + fileLine.columns.sizeInBytes;
        }

        for (final DashboardReader.FileLine file : filesToDownload) {
            final NodePath nodePath = new NodePath(file.contentId);
            pushFileToZip(zos, file.columns.name, new InputStreamProvider() {
                @Override
                public S3ObjectInputStream get() {
                    return fileStorageService.getAsStream(nodePath);
                }
View Full Code Here

        final FileMetaData entity = load(file);
        if (!entity.getOwner().equals(Util.USER_FROM_ID.apply(actor)))
            throw new AccessDenied("Only owner can set content");
        if (RuleValidatorImpl.IS_UPLOAD_COMPLETE.apply(entity))
            throw new AccessDenied("Content already set");
        final NodePath path = storedObjectPaths.rawFilePath(actor, entity.getInstrument().getId(), entity.getName());
        storageService.put(path, content);
        entity.setContentId(path.getPath());
        logger.debug("the content for file with ID = " + file + " for user " + actor + " has been set. Path = " + path.getPath());
        fileRepository.save(entity);
    }
View Full Code Here

TOP

Related Classes of com.infoclinika.mssharing.fileserver.model.NodePath

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.