Examples of baseDirectory()


Examples of org.lightadmin.api.config.annotation.FileReference.baseDirectory()

        Annotation annotation = persistentProperty.findAnnotation(FileReference.class);

        FileReference fileReference = (FileReference) annotation;

        if (isEmpty(fileReference.baseDirectory())) {
            if (lightAdminConfiguration.getFileStorageDirectory() != null) {
                return emptyList();
            }
            return newArrayList(validationContext.missingBaseDirectoryInFileReferenceProblem(fieldMetadata.getName()));
        }
View Full Code Here

Examples of org.lightadmin.api.config.annotation.FileReference.baseDirectory()

                return emptyList();
            }
            return newArrayList(validationContext.missingBaseDirectoryInFileReferenceProblem(fieldMetadata.getName()));
        }

        final File directory = getFile(fileReference.baseDirectory());
        if (directory.exists() && directory.isDirectory()) {
            return emptyList();
        }

        return newArrayList(validationContext.missingBaseDirectoryInFileReferenceProblem(fieldMetadata.getName()));
View Full Code Here

Examples of org.lightadmin.api.config.annotation.FileReference.baseDirectory()

    public File persistentPropertyFileReference(Object entity, PersistentProperty persistentProperty) {
        FileReference fileReference = fileReferenceAnnotation(persistentProperty);
        String relativeFilePath = persistentPropertyFileRelativePath(entity, persistentProperty);

        if (propertyBaseDirectoryExists(fileReference)) {
            return getFile(fileReference.baseDirectory(), relativeFilePath);
        }

        return getFile(this.fileStorageDirectory, relativeFilePath);
    }
View Full Code Here

Examples of org.lightadmin.api.config.annotation.FileReference.baseDirectory()

    @Override
    public File persistentPropertyFileDirectory(Object entity, PersistentProperty persistentProperty) {
        FileReference fileReference = fileReferenceAnnotation(persistentProperty);

        if (propertyBaseDirectoryExists(fileReference)) {
            return getFile(fileReference.baseDirectory(), persistentPropertyFileDirectoryRelativePath(entity, persistentProperty));
        }
        return getFile(this.fileStorageDirectory, persistentPropertyFileDirectoryRelativePath(entity, persistentProperty));
    }

    @Override
View Full Code Here

Examples of org.lightadmin.api.config.annotation.FileReference.baseDirectory()

    private boolean propertyValueFileExists(Object entity, PersistentProperty persistentProperty) {
        FileReference fileReference = fileReferenceAnnotation(persistentProperty);
        String propertyValue = propertyValueAsString(entity, persistentProperty);

        File fileDirectory = propertyBaseDirectoryExists(fileReference) ? getFile(fileReference.baseDirectory()) : this.fileStorageDirectory;

        File file = getFile(fileDirectory, propertyValue);

        return file.isFile() && file.exists();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.