/** * Create an instance of {@link CTOverride } * */ public CTOverride createCTOverride() { return new CTOverride(); }
/** * Add an override content type for a specific part. * * @param partUri * Uri of the part. * @param contentType * Content type of the part. */ public void addOverrideContentType(URI partUri, CTOverride contentType) { log.debug("Registered " + partUri.toString() + " of type " + contentType.getContentType() ); overrideContentType.put(partUri, contentType); }
public void addOverrideContentType(URI partUri, String contentType) { CTOverride overrideCT = ctFactory.createCTOverride(); overrideCT.setPartName( partUri.toASCIIString() ); overrideCT.setContentType(contentType ); overrideContentType.put(partUri, overrideCT); }
URI uri = new URI(overrideCT.getPartName() ); addOverrideContentType(uri, overrideCT );
URI uri = new URI(overrideCT.getPartName() ); addOverrideContentType(uri, overrideCT );
/** * @param partName * @param contentType * @since 6.1.0 */ public void addOverrideContentType(PartName partName, String contentType) { CTOverride defaultCT = ctFactory.createCTOverride(); defaultCT.setPartName(partName.getName()); defaultCT.setContentType(contentType); overrideContentType.put(partName.getURI(), defaultCT); }
public URI getPartNameOverridenByContentType(String contentType) { // hmm, can there only be one instance of a given // content type? Iterator i = overrideContentType.entrySet().iterator(); while (i.hasNext()) { Map.Entry e = (Map.Entry)i.next(); if (e != null) { if (log.isDebugEnabled()) { log.debug("Inspecting " + e.getValue()); } if ( ((CTOverride)e.getValue()).getContentType().equals(contentType) ) { // log.debug("Matched!"); return (URI)e.getKey(); } } } return null; }
/** * Create an instance of {@link CTOverride } * */ public CTOverride createCTOverride() { return new CTOverride(); }
public void addOverrideContentType(URI partUri, String contentType) { CTOverride overrideCT = ctFactory.createCTOverride(); overrideCT.setPartName( partUri.toASCIIString() ); overrideCT.setContentType(contentType ); overrideContentType.put(partUri, overrideCT); }
/** * 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; }
/** * @param partName * @param contentType * @since 6.1.0 */ public void addOverrideContentType(PartName partName, String contentType) { CTOverride defaultCT = ctFactory.createCTOverride(); defaultCT.setPartName(partName.getName()); defaultCT.setContentType(contentType); overrideContentType.put(partName.getURI(), defaultCT); }
String contentType = new String(overrideCT.getContentType()); if (log.isDebugEnabled()) { log.debug("Found content type '" + contentType + "' for " + partName);
/** * Add an override content type for a specific part. * * @param partUri * Uri of the part. * @param contentType * Content type of the part. */ public void addOverrideContentType(URI partUri, CTOverride contentType) { log.debug("Registered " + partUri.toString() + " of type " + contentType.getContentType() ); overrideContentType.put(partUri, contentType); }
public URI getPartNameOverridenByContentType(String contentType) { // hmm, can there only be one instance of a given // content type? Iterator i = overrideContentType.entrySet().iterator(); while (i.hasNext()) { Map.Entry e = (Map.Entry)i.next(); if (e != null) { if (log.isDebugEnabled()) { log.debug("Inspecting " + e.getValue()); } if ( ((CTOverride)e.getValue()).getContentType().equals(contentType) ) { // log.debug("Matched!"); return (URI)e.getKey(); } } } return null; }
/** * 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; }
String contentType = new String(overrideCT.getContentType()); if (log.isDebugEnabled()) { log.debug("Found content type '" + contentType + "' for " + partName);