@Override public final InputStream getStream() { return getBlob().getStream(); } @Override
@Override public void removePart(int index) { if(index < 0) { throw new IllegalArgumentException("The parsed index MUST NOT be < 0"); } if(index == 0){ throw new IllegalStateException("The main ContentPart (index == 0) CAN NOT be removed!"); } writeLock.lock(); try { IRI partUri = getPartUri(index); parts.remove(partUri); } finally { writeLock.unlock(); } } @Override
@Override public String toString() { return String.format("%s uri=[%s], content=[%s;mime-type:%s%s], metadata=[%s triples], " + "parts=%s", getClass().getSimpleName(), //the implementation getUri().getUnicodeString(), //the URI //the size in Bytes (if available) getBlob().getContentLength()>=0 ?("size:"+getBlob().getContentLength()+" bytes;") : "", getBlob().getMimeType(), //the mime-type //and parameter (if available) getBlob().getParameter().isEmpty() ? "" : (";parameter:"+getBlob().getParameter()), getMetadata().size(), //the number of triples parts.keySet()); //and the part URIs }
@Override public String toString() { return String.format("%s uri=[%s], content=[%s;mime-type:%s%s], metadata=[%s triples], " + "parts=%s", getClass().getSimpleName(), //the implementation getUri().getUnicodeString(), //the URI //the size in Bytes (if available) getBlob().getContentLength()>=0 ?("size:"+getBlob().getContentLength()+" bytes;") : "", getBlob().getMimeType(), //the mime-type //and parameter (if available) getBlob().getParameter().isEmpty() ? "" : (";parameter:"+getBlob().getParameter()), getMetadata().size(), //the number of triples parts.keySet()); //and the part URIs }
@Override public final String getMimeType() { return getBlob().getMimeType(); }
@Override public void removePart(int index) { if(index < 0) { throw new IllegalArgumentException("The parsed index MUST NOT be < 0"); } if(index == 0){ throw new IllegalStateException("The main ContentPart (index == 0) CAN NOT be removed!"); } writeLock.lock(); try { IRI partUri = getPartUri(index); parts.remove(partUri); } finally { writeLock.unlock(); } } @Override
@Override public final InputStream getStream() { return getBlob().getStream(); } @Override
@Override public final String getMimeType() { return getBlob().getMimeType(); }