Commit ec01a931 authored by Matija Obreza's avatar Matija Obreza

Javadoc updated

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