/** * {@inheritDoc} * * @see org.osgi.service.http.HttpContext#getMimeType(java.lang.String) */ @Override public String getMimeType(String name) { try { return MimeTypes.fromString(name).toString(); } catch (UnknownFileTypeException e) { return null; } }
/** * Returns the MimeType as a string of the form <code>type/subtype</code> * @deprecated use {@link #toString()} instead */ public String asString() { return toString(); }
public static ProcessInfo mk(String commandLine, Map<String, String> environment, boolean redirectErrorStream) { return new ProcessInfo(mkCommandLine(commandLine), environment, redirectErrorStream); }
/** * Create an empty catalog and register the {@link javax.xml.XMLConstants#W3C_XML_SCHEMA_INSTANCE_NS_URI} * namespace. */ protected XMLCatalogImpl() { super(); bindings = XmlNamespaceContext.mk(XSI_NS_PREFIX, W3C_XML_SCHEMA_INSTANCE_NS_URI); }
@Override public Option<String> apply(MimeType mimeType) { return mimeType.getSuffix(); } };
/** * Open a classpath resource using the class loader of {@link IoSupport}. * * @see #openClassPathResource(String, Class) */ public static Option<InputStream> openClassPathResource(String resource) { return openClassPathResource(resource, IoSupport.class); }
/** * Returns the value of a variable with the same priority replacement scheme as getProperty. * * @param variable * The variable you need the replacement for. * @return The value for variable. * @see org.opencastproject.util.XProperties#getProperty(String) */ public String expandVariable(String variable) { return findReplacement(START_REPLACEMENT + variable + END_REPLACEMENT, variable); }
/** * Convenience method to get a mime type as String from a filename extension * * @param name * the filename * @return the corresponding mime type or DEFAULT_TYPE if no match */ public static String getMimeType(String name) { try { return MimeTypes.fromString(name).toString(); } catch (UnknownFileTypeException e) { return DEFAULT_TYPE; } }
public static ProcessInfo mk(String command, String options, boolean redirectErrorStream) { return new ProcessInfo(mkCommandLine(command, options), NO_ENV, redirectErrorStream); }
public static ProcessInfo mk(String commandLine) { return new ProcessInfo(mkCommandLine(commandLine), NO_ENV, false); }
public static ProcessInfo mk(String commandLine, boolean redirectErrorStream) { return new ProcessInfo(mkCommandLine(commandLine), NO_ENV, redirectErrorStream); }
public static ProcessInfo mk(String command, String options) { return new ProcessInfo(mkCommandLine(command, options), NO_ENV, false); }