Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,7 @@ public TablePrx newTable(final long repo, String path, Current __current)
file.setAtime(time);
file.setMtime(time);
file.setCtime(time);
file.setSha1(omero.rtypes.rstring("UNKNOWN"));
file.setMimetype(omero.rtypes.rstring("OMERO.tables"));
file.setSize(omero.rtypes.rlong(0));
file.setPath(omero.rtypes.rstring(path));
file.setName(omero.rtypes.rstring(path));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ public ome.model.core.OriginalFile asOriginalFile(String mimetype) {
if (file.exists()) {
ofile.setMtime(new Timestamp(file.lastModified()));
if (actualDir) {
// Directories don't have these. TODO: model as a subclass?
ofile.setSha1("");
ofile.setSize(0L);
// TODO: model directories as a subclass?
ofile.setMimetype(PublicRepositoryI.DIRECTORY_MIMETYPE);
if (mimetype != null && !mimeDir) {
// This is a directory, but the user has requested something
Expand All @@ -299,10 +297,6 @@ public ome.model.core.OriginalFile asOriginalFile(String mimetype) {
ofile.setSha1(sha1());
ofile.setSize(file.length());
}
} else {
// File doesn't exist, therefore we know nothing
ofile.setSha1("");
ofile.setSize(0L);
}

// TODO atime/ctime??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.apache.commons.io.filefilter.FileFilterUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4249,7 +4249,6 @@ private synchronized OriginalFile upload(SecurityContext ctx, File file,
oFile.setPath(omero.rtypes.rstring(path));
oFile.setSize(omero.rtypes.rlong(file.length()));
//Need to be modified
oFile.setSha1(omero.rtypes.rstring("pending"));
oFile.setMimetype(omero.rtypes.rstring(mimeType));
save =
(OriginalFile) getUpdateService(ctx).saveAndReturnObject(
Expand All @@ -4269,7 +4268,6 @@ private synchronized OriginalFile upload(SecurityContext ctx, File file,
oFile.setPath(omero.rtypes.rstring(path));
oFile.setSize(omero.rtypes.rlong(file.length()));
//Need to be modified
oFile.setSha1(omero.rtypes.rstring("pending"));
oFile.setMimetype(omero.rtypes.rstring(mimeType));
save = (OriginalFile)
getUpdateService(ctx).saveAndReturnObject(oFile);
Expand All @@ -4282,7 +4280,6 @@ private synchronized OriginalFile upload(SecurityContext ctx, File file,
newFile.setPath(omero.rtypes.rstring(
file.getAbsolutePath()));
newFile.setSize(omero.rtypes.rlong(file.length()));
newFile.setSha1(omero.rtypes.rstring("pending"));
oFile.setMimetype(oFile.getMimetype());
save = (OriginalFile)
getUpdateService(ctx).saveAndReturnObject(newFile);
Expand Down
4 changes: 2 additions & 2 deletions components/model/resources/mappings/acquisition.ome.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
name is the filename of the file, i.e. `basename <file>`
-->
<required name="path" type="text"/>
<required name="size" type="long"/>
<optional name="size" type="long"/>
<optional name="atime" type="timestamp"/>
<optional name="mtime" type="timestamp"/>
<optional name="ctime" type="timestamp"/>
<required name="sha1" type="string"/>
<optional name="sha1" type="string"/>
<optional name="mimetype" type="string"/>
<!--
Has a default set at the DB level of application/octet-stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,11 @@ public void testDeleteImageWithFileAnnotation() throws Exception {
Image i1 = makeImage(true);
ImageAnnotationLink link = new ImageAnnotationLink();
FileAnnotation fa = new FileAnnotation();
OriginalFile of = new OriginalFile("",0L,"","");
OriginalFile of = new OriginalFile("", "");
fa.setFile(of);
link.link(i1, fa);
iUpdate.saveObject(fa);
IDelete srv = this.factory.getDeleteService();
srv.deleteImage(i1.getId(), true);
}



}
4 changes: 2 additions & 2 deletions sql/psql/OMERO5.0DEV__1/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1427,8 +1427,8 @@
mtime timestamp,
name varchar(255) not null,
path text not null,
sha1 varchar(255) not null,
"size" int8 not null,
sha1 varchar(255),
"size" int8,
version int4,
creation_id int8 not null,
external_id int8 unique,
Expand Down