/** * 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 "
/** * 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 "