Search in sources :

Example 11 with AttachmentState

use of org.obiba.mica.file.AttachmentState in project mica2 by obiba.

the class FileSystemService method move.

/**
 * Move a file to another path location.
 *
 * @param path
 * @param name
 * @param newPath
 */
public void move(String path, String name, String newPath) {
    AttachmentState state = getAttachmentState(path, name, false);
    move(state, newPath, state.getName());
}
Also used : AttachmentState(org.obiba.mica.file.AttachmentState)

Example 12 with AttachmentState

use of org.obiba.mica.file.AttachmentState in project mica2 by obiba.

the class FileSystemService method copy.

/**
 * Copy a file into another path location.
 *
 * @param path
 * @param name
 * @param newPath
 */
public void copy(String path, String name, String newPath) {
    AttachmentState state = getAttachmentState(path, name, false);
    copy(state, newPath, state.getName(), false);
}
Also used : AttachmentState(org.obiba.mica.file.AttachmentState)

Aggregations

AttachmentState (org.obiba.mica.file.AttachmentState)12 Attachment (org.obiba.mica.file.Attachment)3 ObjectId (org.bson.types.ObjectId)2 RevisionStatus (org.obiba.mica.core.domain.RevisionStatus)2 FileUpdatedEvent (org.obiba.mica.file.event.FileUpdatedEvent)2 Strings (com.google.common.base.Strings)1 Lists (com.google.common.collect.Lists)1 Subscribe (com.google.common.eventbus.Subscribe)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 List (java.util.List)1 NoSuchElementException (java.util.NoSuchElementException)1 Collectors (java.util.stream.Collectors)1 ZipEntry (java.util.zip.ZipEntry)1 ZipOutputStream (java.util.zip.ZipOutputStream)1 Nullable (javax.annotation.Nullable)1 Inject (javax.inject.Inject)1 NotNull (javax.validation.constraints.NotNull)1 Pair (org.apache.commons.math3.util.Pair)1