Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
File down.java,
1.1 KB
(added by jmoore, 14 years ago) |
Simple example of what produced a 0-sized download.
|
Line | |
---|
1 | import java.io.*; |
---|
2 | import omero.*; |
---|
3 | import omero.api.*; |
---|
4 | import omero.grid.*; |
---|
5 | import omero.model.*; |
---|
6 | import static omero.rtypes.*; |
---|
7 | |
---|
8 | public class down { |
---|
9 | public static void main(String[] args) throws Exception { |
---|
10 | client c = new client(); |
---|
11 | try { |
---|
12 | ServiceFactoryPrx sf = c.createSession(); |
---|
13 | SharedResourcesPrx sr = sf.sharedResources(); |
---|
14 | TablePrx table = sr.newTable(1, "test.h5"); |
---|
15 | |
---|
16 | if (table == null) { |
---|
17 | throw new RuntimeException("Null table"); |
---|
18 | } |
---|
19 | |
---|
20 | OriginalFile file = null; |
---|
21 | try { |
---|
22 | file = table.getOriginalFile(); |
---|
23 | LongColumn lc = new LongColumn("a1","desc",new long[]{1l}); |
---|
24 | table.initialize(new Column[]{lc}); |
---|
25 | table.addData(new Column[]{lc}); |
---|
26 | } finally { |
---|
27 | table.close(); |
---|
28 | } |
---|
29 | |
---|
30 | if (file == null) { |
---|
31 | throw new RuntimeException("Null file"); |
---|
32 | } |
---|
33 | |
---|
34 | c.download(file.getId().getValue(), new File("test.h5")); |
---|
35 | |
---|
36 | } finally { |
---|
37 | c.closeSession(); |
---|
38 | } |
---|
39 | } |
---|
40 | } |
---|
Download in other formats:
1.3.13-PRO © 2008-2011
Agilo Software all
rights reserved
(this page was served in: 0.20327 sec.)