1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.ws.io.mime; |
22 |
|
|
23 |
|
import jalview.io.packed.DataProvider.JvDataType; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
@author |
29 |
|
|
30 |
|
|
|
|
| 0% |
Uncovered Elements: 19 (19) |
Complexity: 6 |
Complexity Density: 0.67 |
|
31 |
|
public class MimeTypes |
32 |
|
{ |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
final public static Object[] typemap = new Object[] { |
38 |
|
"application/x-align", JvDataType.ALIGNMENT, |
39 |
|
"application/x-jalview-annotation", JvDataType.ANNOTATION, |
40 |
|
"application/x-newick", JvDataType.TREE, |
41 |
|
"application/x-new-hampshire", JvDataType.TREE, |
42 |
|
"application/x-new-hampshire-extended", JvDataType.TREE, |
43 |
|
"application/x-nh", JvDataType.TREE, "application/x-nhx", |
44 |
|
JvDataType.TREE, "application/x-gff", JvDataType.FEATURES, |
45 |
|
"application/x-gff3", JvDataType.FEATURES, |
46 |
|
"application/x-jalview-feature-file", JvDataType.FEATURES, |
47 |
|
"application/x-pdb", JvDataType.SEQASSOCATED }; |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
@param |
52 |
|
@return |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
54 |
0 |
public static JvDataType getTypeOf(String mimeType)... |
55 |
|
{ |
56 |
0 |
String mt = mimeType.toLowerCase(); |
57 |
0 |
for (int i = 0; i < typemap.length; i += 2) |
58 |
|
{ |
59 |
0 |
if (typemap[i].equals(mt)) |
60 |
|
{ |
61 |
0 |
return (JvDataType) typemap[i + 1]; |
62 |
|
} |
63 |
|
} |
64 |
0 |
return null; |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
@param |
70 |
|
@return |
71 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
72 |
0 |
public static String getMimeTypeOf(JvDataType type)... |
73 |
|
{ |
74 |
0 |
for (int i = 1; i < typemap.length; i += 2) |
75 |
|
{ |
76 |
0 |
if (typemap[i].equals(type)) |
77 |
|
{ |
78 |
0 |
return (String) typemap[i - 1]; |
79 |
|
} |
80 |
|
} |
81 |
0 |
return null; |
82 |
|
} |
83 |
|
} |