1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.search;
21
22 import java.io.Serializable;
23
24 import org.xnap.XNap;
25
26 /***
27 * Provides the media type that matches any file.
28 */
29 public class AnythingMediaType implements MediaType, Serializable
30 {
31
32
33
34
35
36
37
38 public AnythingMediaType()
39 {
40 }
41
42
43
44 /***
45 * Returns the translation of "Default".
46 */
47 public String getName()
48 {
49 return XNap.tr("Default");
50 }
51
52 /***
53 * Returns "anything".
54 */
55 public String getRealm()
56 {
57 return "anything";
58 }
59
60 /***
61 * Always returns true;
62 */
63 public boolean matches(String filename)
64 {
65 return true;
66 }
67
68 /***
69 * Returns the value of {@link #getName()}.
70 */
71 public String toString()
72 {
73 return getName();
74 }
75
76 }