/** * Create an instance of {@link CTDefault } * */ public CTDefault createCTDefault() { return new CTDefault(); }
/** * Get the content type for the specified part, if any. * * @param partUri * The URI part to check. * @return The content type associated with the URI (in case of an override * content type) or the extension (in case of default content type), * else <code>null</code>. */ public String getContentType(PartName partName) { if (partName == null) throw new IllegalArgumentException("partName"); if ((this.overrideContentType != null) && this.overrideContentType.containsKey(partName.getURI())) return this.overrideContentType.get(partName.getURI()).getContentType(); String extension = partName.getExtension().toLowerCase(); if (this.defaultContentType.containsKey(extension)) return this.defaultContentType.get(extension).getContentType(); return null; }
public void addDefaultContentType(String extension, String contentType) { CTDefault defaultCT = ctFactory.createCTDefault(); defaultCT.setExtension(extension.toLowerCase()); defaultCT.setContentType(contentType); log.debug("Registered " + extension ); defaultContentType.put(extension.toLowerCase(), defaultCT); }
addDefaultContentType( defaultCT.getExtension(), defaultCT );
addDefaultContentType( defaultCT.getExtension(), defaultCT );
public void addDefaultContentType(String extension, String contentType) { CTDefault defaultCT = ctFactory.createCTDefault(); defaultCT.setExtension(extension.toLowerCase()); defaultCT.setContentType(contentType); log.debug("Registered " + extension ); defaultContentType.put(extension.toLowerCase(), defaultCT); }
CTDefault defaultCT = (CTDefault)defaultContentType.get(ext); if (defaultCT!=null ) { String contentType = defaultCT.getContentType(); if (log.isDebugEnabled()) { log.debug("Found content type '" + contentType + "' for "
/** * Create an instance of {@link CTDefault } * */ public CTDefault createCTDefault() { return new CTDefault(); }
/** * Get the content type for the specified part, if any. * * @param partUri * The URI part to check. * @return The content type associated with the URI (in case of an override * content type) or the extension (in case of default content type), * else <code>null</code>. */ public String getContentType(PartName partName) { if (partName == null) throw new IllegalArgumentException("partName"); if ((this.overrideContentType != null) && this.overrideContentType.containsKey(partName.getURI())) return this.overrideContentType.get(partName.getURI()).getContentType(); String extension = partName.getExtension().toLowerCase(); if (this.defaultContentType.containsKey(extension)) return this.defaultContentType.get(extension).getContentType(); return null; }
CTDefault defaultCT = (CTDefault)defaultContentType.get(ext); if (defaultCT!=null ) { String contentType = defaultCT.getContentType(); if (log.isDebugEnabled()) { log.debug("Found content type '" + contentType + "' for "