001/* 002 * The contents of this file are subject to the license and copyright 003 * detailed in the LICENSE and NOTICE files at the root of the source 004 * tree. 005 */ 006package org.fcrepo.kernel.impl.operations; 007 008import org.apache.commons.lang3.NotImplementedException; 009import org.fcrepo.kernel.api.Transaction; 010import org.fcrepo.kernel.api.identifiers.FedoraId; 011import org.fcrepo.kernel.api.operations.UpdateNonRdfSourceHeadersOperation; 012 013import java.io.InputStream; 014import java.net.URI; 015import java.util.Collection; 016 017/** 018 * Operation to update the headers of a non-rdf resource 019 * @author bbpennel 020 */ 021public class UpdateNonRdfSourceHeadersOperationImpl extends AbstractRelaxableResourceOperation 022 implements UpdateNonRdfSourceHeadersOperation { 023 024 private String mimeType; 025 026 private String filename; 027 028 public UpdateNonRdfSourceHeadersOperationImpl(final Transaction transaction, final FedoraId resourceId) { 029 super(transaction, resourceId); 030 } 031 032 @Override 033 public InputStream getContentStream() { 034 throw new UnsupportedOperationException("Not supported for header update operation"); 035 } 036 037 @Override 038 public String getExternalHandling() { 039 throw new UnsupportedOperationException("Not supported for header update operation"); 040 } 041 042 @Override 043 public URI getContentUri() { 044 throw new UnsupportedOperationException("Not supported for header update operation"); 045 } 046 047 @Override 048 public String getMimeType() { 049 return mimeType; 050 } 051 052 @Override 053 public String getFilename() { 054 return filename; 055 } 056 057 @Override 058 public Collection<URI> getContentDigests() { 059 throw new NotImplementedException("Not supported for header update operation"); 060 } 061 062 @Override 063 public long getContentSize() { 064 throw new NotImplementedException("Not supported for header update operation"); 065 } 066 067 /** 068 * @param mimeType the mimeType to set 069 */ 070 protected void setMimeType(final String mimeType) { 071 this.mimeType = mimeType; 072 } 073 074 /** 075 * @param filename the filename to set 076 */ 077 protected void setFilename(final String filename) { 078 this.filename = filename; 079 } 080}