Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2014 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 
 package com.google.cloud.hadoop.gcsio;
 
 
 import java.util.Map;

Options that can be specified when creating a file in the GoogleCloudFileSystem.
 
 public class CreateFileOptions {
   public static final Map<Stringbyte[]> EMPTY_ATTRIBUTES = ImmutableMap.of();
   public static final String DEFAULT_CONTENT_TYPE = "application/octet-stream";
   public static final CreateFileOptions DEFAULT =
 
   private final boolean overwriteExisting;
   private final String contentType;
   private final Map<Stringbyte[]> attributes;

  
Create a file with empty attributes and optionally overwriting any existing file.

Parameters:
overwriteExisting True to overwrite an existing file with the same name
 
   public CreateFileOptions(boolean overwriteExisting) {
     this(overwriteExisting);
   }

  
Create a file with empty attributes, and optionally overwriting any existing file with one having the given content-type.

Parameters:
overwriteExisting True to overwrite an existing file with the same name
contentType content-type for the created file
 
   public CreateFileOptions(boolean overwriteExistingString contentType) {
     this(overwriteExistingcontentType);
   }

  
Create a file with specified attributes and optionally overwriting an existing file.

Parameters:
overwriteExisting True to overwrite an existing file with the same name
attributes File attributes to apply to the file at creation
 
   public CreateFileOptions(boolean overwriteExistingMap<Stringbyte[]> attributes) {
     this(overwriteExistingattributes);
   }

  
Create a file with specified attributes, and optionally overwriting an existing file with one having the given content-type.

Parameters:
overwriteExisting True to overwrite an existing file with the same name
contentType content-type for the created file
attributes File attributes to apply to the file at creation
 
   public CreateFileOptions(boolean overwriteExistingString contentType,
       Map<Stringbyte[]> attributes) {
     Preconditions.checkArgument(!attributes.containsKey("Content-Type"),
         "The Content-Type attribute must be provided explicitly via the 'contentType' parameter");
     this. = overwriteExisting;
     this. = contentType;
     this. = attributes;
   }

  
Get the value of overwriteExisting.
 
   public boolean overwriteExisting() {
     return ;
   }

  
Content-type to set when creating a file.
 
   public String getContentType() {
     return ;
   }

  
Extended attributes to set when creating a file.
  public Map<Stringbyte[]> getAttributes() {
    return ;
  }
New to GrepCode? Check out our FAQ X