mirror of https://github.com/apache/jclouds.git
added additional properties to Payload for content disposition management
This commit is contained in:
parent
be69174a20
commit
bf96564582
|
@ -72,6 +72,54 @@ public interface Payload extends InputSupplier<InputStream>, WriteTo, Closeable
|
|||
@Nullable
|
||||
String getContentType();
|
||||
|
||||
|
||||
/**
|
||||
* Set Content Disposition of the payload
|
||||
* <p/>
|
||||
* Not all providers may support it
|
||||
*
|
||||
* @param contentDisposition
|
||||
*/
|
||||
void setContentDisposition(@Nullable String contentDisposition);
|
||||
|
||||
/**
|
||||
* Get Content Disposition of the payload
|
||||
* <p/>
|
||||
* Not all providers may support it
|
||||
*/
|
||||
@Nullable String getContentDisposition();
|
||||
|
||||
/**
|
||||
* Set Content Language of the payload
|
||||
* <p/>
|
||||
* Not all providers may support it
|
||||
*
|
||||
* @param contentLanguage
|
||||
*/
|
||||
void setContentLanguage(@Nullable String contentLanguage);
|
||||
/**
|
||||
* Get Content Language of the payload
|
||||
* <p/>
|
||||
* Not all providers may support it
|
||||
*/
|
||||
@Nullable String getContentLanguage();
|
||||
|
||||
/**
|
||||
* Set Content Encoding of the payload
|
||||
* <p/>
|
||||
* Not all providers may support it
|
||||
*
|
||||
* @param contentEncoding
|
||||
*/
|
||||
void setContentEncoding(@Nullable String contentEncoding);
|
||||
/**
|
||||
* Get Content Encoding of the payload
|
||||
* <p/>
|
||||
* Not all providers may support it
|
||||
*/
|
||||
@Nullable String getContentEncoding();
|
||||
|
||||
|
||||
/**
|
||||
* release resources used by this entity. This should be called when data is
|
||||
* discarded.
|
||||
|
|
|
@ -40,6 +40,9 @@ public abstract class BasePayload<V> implements Payload {
|
|||
protected String contentType;
|
||||
protected Long contentLength;
|
||||
protected byte[] contentMD5;
|
||||
protected String contentDisposition;
|
||||
protected String contentLanguage;
|
||||
protected String contentEncoding;
|
||||
protected transient volatile boolean written;
|
||||
|
||||
protected BasePayload(V content, @Nullable String contentType,
|
||||
|
@ -118,6 +121,54 @@ public abstract class BasePayload<V> implements Payload {
|
|||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setContentDisposition(@Nullable String contentDisposition) {
|
||||
this.contentDisposition = contentDisposition;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getContentDisposition() {
|
||||
return this.contentDisposition;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setContentLanguage(@Nullable String contentLanguage) {
|
||||
this.contentLanguage = contentLanguage;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getContentLanguage() {
|
||||
return this.contentLanguage;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setContentEncoding(@Nullable String contentEncoding) {
|
||||
this.contentEncoding = contentEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getContentEncoding() {
|
||||
return this.contentEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
|
|
@ -119,6 +119,54 @@ public class DelegatingPayload implements Payload {
|
|||
delegate.setContentType(md5);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setContentDisposition(String contentDisposition) {
|
||||
delegate.setContentDisposition(contentDisposition);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getContentDisposition() {
|
||||
return delegate.getContentDisposition();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setContentLanguage(String contentLanguage) {
|
||||
delegate.setContentLanguage(contentLanguage);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getContentLanguage() {
|
||||
return delegate.getContentLanguage();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setContentEncoding(String contentEncoding) {
|
||||
delegate.setContentEncoding(contentEncoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getContentEncoding() {
|
||||
return delegate.getContentEncoding();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
|
|
@ -112,6 +112,54 @@ public class StreamingPayload implements Payload {
|
|||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setContentDisposition(String contentDisposition) {
|
||||
throw new UnsupportedOperationException("this payload is for streaming writes only");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getContentDisposition() {
|
||||
throw new UnsupportedOperationException("this payload is for streaming writes only");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setContentLanguage(String contentLanguage) {
|
||||
throw new UnsupportedOperationException("this payload is for streaming writes only");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getContentLanguage() {
|
||||
throw new UnsupportedOperationException("this payload is for streaming writes only");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setContentEncoding(String contentEncoding) {
|
||||
throw new UnsupportedOperationException("this payload is for streaming writes only");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getContentEncoding() {
|
||||
throw new UnsupportedOperationException("this payload is for streaming writes only");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -172,4 +220,5 @@ public class StreamingPayload implements Payload {
|
|||
public void close() {
|
||||
release();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue