/** * {@inheritDoc} */ public Photo createProperty(final List<Parameter> params, final String value) throws URISyntaxException, DecoderException { return new Photo(params, value); }
/** * {@inheritDoc} */ @Override public void validate() throws ValidationException { // for (Parameter param : getParameters()) { // assertPidParameter(param); // } assertOneOrLess(net.fortuna.ical4j.vcard.Parameter.Id.VALUE); }
/** * @param binary a byte array of photo data * @param contentType the MIME type of the photo data */ public Photo(byte[] binary, Type contentType) { super(Id.PHOTO); this.binary = binary; getParameters().add(Encoding.B); if (contentType != null) { getParameters().add(contentType); } }
private void createPhoto(URI uri, URI prop, Photo photo) throws RDFHandlerException, RDFParseException { if(photo.getUri() != null) { URI r_logo = createURI(photo.getUri().toString()); rdfHandler.handleStatement(createStatement(uri,prop,r_logo)); } else { log.warn("ignoring photo relation, since binary photos are not supported in RDF"); } }
/** * Factory constructor. * @param params property parameters * @param value string representation of a property value * @throws URISyntaxException where the specified URI value is not a valid URI * @throws DecoderException where the specified photo data value cannot be decoded */ public Photo(List<Parameter> params, String value) throws URISyntaxException, DecoderException { super(Id.PHOTO, params); final Parameter valueParameter = getParameter(Parameter.Id.VALUE); /* * in the relaxed parsing mode we allow the vcard 2.1-style VALUE=URL parameter */ if (valueParameter != null && Value.URI.equals(valueParameter) || valueParameter != null && CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING) && "URL".equalsIgnoreCase(valueParameter.getValue())) { this.uri = new URI(value); } else { final BinaryDecoder decoder = new Base64(); this.binary = decoder.decode(value.getBytes()); } }
private void createPhoto(URI uri, URI prop, Photo photo) throws RDFHandlerException, RDFParseException { if(photo.getUri() != null) { URI r_logo = createURI(photo.getUri().toString()); rdfHandler.handleStatement(createStatement(uri,prop,r_logo)); } else { log.warn("ignoring photo relation, since binary photos are not supported in RDF"); } }
/** * Factory constructor. * * @param params property parameters * @param value string representation of a property value * @throws URISyntaxException where the specified URI value is not a valid URI * @throws DecoderException where the specified photo data value cannot be decoded */ public Photo(List<Parameter> params, String value) throws URISyntaxException, DecoderException { super(Id.PHOTO, params); final Parameter valueParameter = getParameter(Parameter.Id.VALUE); /* * in the relaxed parsing mode we allow the vcard 2.1-style VALUE=URL parameter */ if (Value.URI.equals(valueParameter) || valueParameter != null && CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING) && "URL".equalsIgnoreCase(valueParameter.getValue())) { this.uri = new URI(value); } else { final BinaryDecoder decoder = new Base64(); this.binary = decoder.decode(value.getBytes()); } }
/** * @param uri a URI that specifies the location of a photo */ public Photo(URI uri) { super(Id.PHOTO); this.uri = uri; getParameters().add(Value.URI); }
/** * {@inheritDoc} */ public Photo createProperty(final List<Parameter> params, final String value) throws URISyntaxException, DecoderException { return new Photo(params, value); }
/** * {@inheritDoc} */ @Override public void validate() throws ValidationException { // for (Parameter param : getParameters()) { // assertPidParameter(param); // } assertOneOrLess(net.fortuna.ical4j.vcard.Parameter.Id.VALUE); }
/** * @param uri a URI that specifies the location of a photo */ public Photo(URI uri) { super(Id.PHOTO); this.uri = uri; getParameters().add(Value.URI); }
/** * @param binary a byte array of photo data * @param contentType the MIME type of the photo data */ public Photo(byte[] binary, Type contentType) { super(Id.PHOTO); this.binary = binary; getParameters().add(Encoding.B); if (contentType != null) { getParameters().add(contentType); } }