Commit ec01a931 authored by Matija Obreza's avatar Matija Obreza

Javadoc updated

parent 73a31dd0
......@@ -159,6 +159,19 @@
<version>${spring.data.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>2.1.15.RELEASE</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Hibernate dependencies -->
<dependency>
<groupId>org.hibernate</groupId>
......
/*
* Copyright 2018 Global Crop Diversity Trust
* Copyright 2020 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -40,7 +40,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
/**
* Creates {@link RepositoryFolder} entries and their parents - Links all
* {@link RepositoryFile} to their parent folders
* {@link RepositoryFile} to their parent folders.
*
* @author Matija Obreza
*/
......@@ -65,6 +65,11 @@ public class RepositoryUpgrade20180920 {
@Autowired
private JPAQueryFactory jpaQueryFactory;
/**
* Do upgrade.
*
* @throws Exception the exception
*/
public void doUpgrade() throws Exception {
TransactionTemplate tmpl = new TransactionTemplate(txManager);
tmpl.execute(new TransactionCallbackWithoutResult() {
......
......@@ -31,7 +31,7 @@ public interface ImageGalleryPersistence extends JpaRepository<ImageGallery, Lon
/**
* Find gallery for specified path.
*
* @param path The path of image gallery in the repository
* @param folder the folder
* @return the Gallery!
*/
ImageGallery findByFolder(RepositoryFolder folder);
......
......@@ -24,7 +24,6 @@ import org.genesys.filerepository.model.RepositoryDocument;
import org.genesys.filerepository.model.RepositoryFolder;
import org.springframework.stereotype.Repository;
// TODO: Auto-generated Javadoc
/**
* The Interface RepositoryDocumentPersistence.
*/
......@@ -42,7 +41,7 @@ public interface RepositoryDocumentPersistence extends RepositoryPersistence<Rep
/**
* Find by folder.
*
* @param repositoryPath the repository folder
* @param folder the folder
* @return the list
*/
List<RepositoryDocument> findByFolder(RepositoryFolder folder);
......
......@@ -26,7 +26,6 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
import org.springframework.stereotype.Repository;
// TODO: Auto-generated Javadoc
/**
* The Interface RepositoryFilePersistence.
*/
......
......@@ -26,7 +26,6 @@ import org.springframework.data.domain.Sort;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
import org.springframework.stereotype.Repository;
// TODO: Auto-generated Javadoc
/**
* The Interface RepositoryImagePersistence.
*/
......@@ -51,9 +50,10 @@ public interface RepositoryImagePersistence extends RepositoryPersistence<Reposi
RepositoryImage findByUuidAndVersion(UUID fileUuid, int version);
/**
* Find by folder
* Find by folder.
*
* @param repositoryPath the repository folder
* @param folder the folder
* @param sort the sort
* @return the list
*/
List<RepositoryImage> findByFolder(RepositoryFolder folder, final Sort sort);
......
......@@ -107,9 +107,9 @@ public interface ImageGalleryService {
ImageGallery saveImageOrder(ImageGallery imageGallery);
/**
* Ensure that thumbnails are created for pre-configured thumbnail sizes
*
* @param imageGallery
* Ensure that thumbnails are created for pre-configured thumbnail sizes.
*
* @param imageGallery the image gallery
*/
void ensureThumbnails(ImageGallery imageGallery);
......@@ -135,7 +135,7 @@ public interface ImageGalleryService {
/**
* List image galleries at repository path starting with <code>prefix</code>.
*
* @param prefix the prefix
* @param root the root
* @param pageable the pageable
* @return paginated image gallery data
* @throws InvalidRepositoryPathException if path is not a valid repository path
......
......@@ -107,8 +107,8 @@ public interface RepositoryService {
* @param path the path
* @param filename the filename
* @return the file
* @throws InvalidRepositoryPathException if path is not a valid repository path
* @throws NoSuchRepositoryFileException the no such repository file exception
* @throws InvalidRepositoryPathException if path is not a valid repository path
*/
RepositoryFile getFile(Path path, String filename) throws NoSuchRepositoryFileException, InvalidRepositoryPathException;
......@@ -125,9 +125,9 @@ public interface RepositoryService {
* List all files at the specified repository path.
*
* @param folderPath the folder path
* @param sort the sort
* @return the files
* @throws InvalidRepositoryPathException if path is not a valid repository path
* @throws NoSuchRepositoryFileException
*/
List<RepositoryFile> getFiles(Path folderPath, Sort sort) throws InvalidRepositoryPathException;
......@@ -144,9 +144,10 @@ public interface RepositoryService {
/**
* Stream file info at the specified repository path.
*
* @param repositoryPath the repository path
* @param root the root
* @param sort the sort
* @return the files
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
Stream<RepositoryFile> streamFiles(Path root, Sort sort) throws InvalidRepositoryPathException;
......@@ -202,7 +203,7 @@ public interface RepositoryService {
* Move the file to a different repository path.
*
* @param repositoryFile the repository file
* @param newPath the new path
* @param target the target
* @return the repository file
* @throws NoSuchRepositoryFileException the no such repository file exception
* @throws InvalidRepositoryPathException if path is not a valid repository path
......@@ -225,6 +226,7 @@ public interface RepositoryService {
* List all {@link RepositoryImage} entries at specified path.
*
* @param path the path
* @param sort the sort
* @return the list
*/
List<RepositoryImage> listImages(Path path, Sort sort);
......@@ -233,7 +235,7 @@ public interface RepositoryService {
* List all paths within the root Path, including the root folder itself if it
* exists.
*
* @param prefix the prefix
* @param root the root
* @return the list
* @throws InvalidRepositoryPathException if path is not a valid repository path
*/
......@@ -261,15 +263,15 @@ public interface RepositoryService {
RepositoryImage removeImage(RepositoryImage repositoryImage) throws NoSuchRepositoryFileException, IOException;
/**
* Get folder by UUID
*
* Get folder by UUID.
*
* @param uuid folder UUID
* @return the folder
*/
RepositoryFolder getFolder(UUID uuid);
/**
* Gets the folder by path
* Gets the folder by path.
*
* @param folderPath the folder path
* @return the folder
......@@ -282,7 +284,8 @@ public interface RepositoryService {
*
* @param folder the folder
* @return the updated repository folder
* @throws NoSuchRepositoryFolderException
* @throws NoSuchRepositoryFolderException the no such repository folder
* exception
*/
RepositoryFolder updateFolder(RepositoryFolder folder) throws NoSuchRepositoryFolderException;
......@@ -308,27 +311,27 @@ public interface RepositoryService {
/**
* Register a folder at specified path. Creates a new record if path is not
* found.
*
*
* @param path the folder path
* @return a {@link RepositoryFolder}
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
RepositoryFolder ensureFolder(Path path) throws InvalidRepositoryPathException;
/**
* Ensure folder exists with specified ACL parent object
*
* Ensure folder exists with specified ACL parent object.
*
* @param path the folder path in repository
* @param aclParentObject business entity "owning" the folder
* @return
* @throws InvalidRepositoryPathException
* @return the repository folder
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
RepositoryFolder ensureFolder(Path path, AclAwareModel aclParentObject) throws InvalidRepositoryPathException;
/**
* Delete an empty folder (no children, no files).
*
* @param string repository path
* @param path the path
* @return the deleted repository folder
* @throws FolderNotEmptyException if folder contains sub-folders or files
* @throws InvalidRepositoryPathException if path is not a valid repository path
......@@ -336,10 +339,11 @@ public interface RepositoryService {
RepositoryFolder deleteFolder(Path path) throws FolderNotEmptyException, InvalidRepositoryPathException;
/**
* Get subfolders of root
*
* @param root
* @return
* Get subfolders of root.
*
* @param root the root
* @param sort the sort
* @return the folders
* @throws InvalidRepositoryPathException if path is not a valid repository path
*/
List<RepositoryFolder> getFolders(Path root, Sort sort) throws InvalidRepositoryPathException;
......
......@@ -65,7 +65,7 @@ public abstract class AbstractImageGalleryAspects {
* Adds the image to gallery.
*
* @param repositoryImage the repository image
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
protected abstract void addImageToGallery(RepositoryImage repositoryImage) throws InvalidRepositoryPathException;
......@@ -125,7 +125,7 @@ public abstract class AbstractImageGalleryAspects {
* Removes the image from gallery.
*
* @param repositoryImage the repository image
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
protected abstract void removeImageFromGallery(RepositoryImage repositoryImage) throws InvalidRepositoryPathException;
}
\ No newline at end of file
......@@ -112,6 +112,7 @@ public abstract class AbstractRepositoryFolderAspects {
* On remove folder.
*
* @param repositoryFolder the repository folder
* @throws FileRepositoryException the file repository exception
*/
protected abstract void onRemoveFolder(RepositoryFolder repositoryFolder) throws FileRepositoryException;
......@@ -119,6 +120,7 @@ public abstract class AbstractRepositoryFolderAspects {
* On add folder.
*
* @param repositoryFolder the repository folder
* @throws FileRepositoryException the file repository exception
*/
protected abstract void onSaveFolder(RepositoryFolder repositoryFolder) throws FileRepositoryException;
}
\ No newline at end of file
......@@ -76,7 +76,7 @@ public class ImageGalleryAspectsImpl extends AbstractImageGalleryAspects impleme
* add it to the gallery if it exists.
*
* @param repositoryImage the repository image
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
@Override
public void addImageToGallery(final RepositoryImage repositoryImage) throws InvalidRepositoryPathException {
......@@ -112,7 +112,7 @@ public class ImageGalleryAspectsImpl extends AbstractImageGalleryAspects impleme
* Check if image is part of a gallery at the specified path and remove it.
*
* @param repositoryImage the repository image
* @throws InvalidRepositoryPathException
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
@Override
public void removeImageFromGallery(final RepositoryImage repositoryImage) throws InvalidRepositoryPathException {
......
......@@ -116,7 +116,7 @@ public class FilesystemStorageServiceImpl implements InitializingBean, BytesStor
}
/**
* Gets the path where subPath a sub-folder of {@link #repoDir}
* Gets the path where subPath a sub-folder of {@link #repoDir}.
*
* @param subPath the normal path
* @return the dest path
......
......@@ -57,7 +57,7 @@ import com.querydsl.jpa.impl.JPAQuery;
import com.querydsl.jpa.impl.JPAQueryFactory;
/**
* Image Gallery service
* Image Gallery service.
*/
@Service
@Transactional(readOnly = true)
......@@ -437,6 +437,11 @@ public class ImageGalleryServiceImpl implements ImageGalleryService {
return new PageImpl<>(content, pageable, total);
}
/**
* Sets the thumbnail sizes.
*
* @param thumbnailSizes the new thumbnail sizes
*/
public void setThumbnailSizes(int[] thumbnailSizes) {
Arrays.sort(thumbnailSizes);
this.thumbnailSizes = thumbnailSizes;
......
......@@ -45,7 +45,7 @@ public class PathValidator {
/**
* Checks if folder name is valid.
*
* @param path the path
* @param name the name
* @return true, if path is valid
*/
protected static boolean isValidFolderName(final String name) {
......
......@@ -481,8 +481,7 @@ public class S3StorageServiceImpl implements BytesStorageService, InitializingBe
/**
* http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectHEAD.html
*
* @param path the path
* @param filename the filename
* @param bytesFile the bytes file
* @return true, if successful
* @throws IOException when other stuff is bad
* @throws InvalidRepositoryPathException when path or filename are weird
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment