Ejemplo n.º 1
0
 @Override
 public boolean containsKey(String key) {
   if (null != key) {
     if ((null != this.modifiedHeader)
         && this.modifiedHeader.containsKey(S3Headers.CONTENT_TYPE.toString())) return true;
     else if ((null != s3Object) && s3Object.containsKey(S3Headers.CONTENT_TYPE.toString()))
       return true;
     else return false;
   } else throw new NullPointerException("Argument 'key' must not be null");
 }
Ejemplo n.º 2
0
 @Override
 public Resource setContentType(MimeType mimeType) {
   // you can only set a content type to a file
   if ((null != this.s3Object) && isDirectory(this.s3Object.uri)) {
     throw new IllegalStateException("Cant't set content type for directory resource");
   }
   if (null == this.modifiedHeader) initModifiedHeader();
   this.modifiedHeader.put(S3Headers.CONTENT_TYPE.toString(), mimeType.toString());
   return this;
 }