Package com.google.cloud.hadoop.gcsio
Class CreateFileOptions
- java.lang.Object
-
- com.google.cloud.hadoop.gcsio.CreateFileOptions
-
public abstract class CreateFileOptions extends Object
Options that can be specified when creating a file in theGoogleCloudStorageFileSystem.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCreateFileOptions.BuilderBuilder forCreateFileOptionsstatic classCreateFileOptions.WriteMode
-
Field Summary
Fields Modifier and Type Field Description static CreateFileOptionsDEFAULT
-
Constructor Summary
Constructors Constructor Description CreateFileOptions()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CreateFileOptions.Builderbuilder()abstract com.google.common.collect.ImmutableMap<String,byte[]>getAttributes()Extended attributes to set when creating a file.abstract StringgetContentType()Content-type to set when creating a file.abstract DurationgetMinSyncInterval()Configures the minimum time interval (milliseconds) between consecutive sync/flush callsabstract longgetOverwriteGenerationId()Generation of existing object to overwrite.abstract CreateFileOptions.WriteModegetWriteMode()Whether to overwrite an existing file with the same name.abstract booleanisEnsureNoDirectoryConflict()If true, makes sure there isn't already a directory object of the same name.abstract CreateFileOptions.BuildertoBuilder()
-
-
-
Field Detail
-
DEFAULT
public static final CreateFileOptions DEFAULT
-
-
Method Detail
-
builder
public static CreateFileOptions.Builder builder()
-
toBuilder
public abstract CreateFileOptions.Builder toBuilder()
-
getAttributes
public abstract com.google.common.collect.ImmutableMap<String,byte[]> getAttributes()
Extended attributes to set when creating a file.
-
getContentType
@Nullable public abstract String getContentType()
Content-type to set when creating a file.
-
getMinSyncInterval
public abstract Duration getMinSyncInterval()
Configures the minimum time interval (milliseconds) between consecutive sync/flush calls
-
isEnsureNoDirectoryConflict
public abstract boolean isEnsureNoDirectoryConflict()
If true, makes sure there isn't already a directory object of the same name. If false, you run the risk of creating hard-to-cleanup/access files whose names collide with directory names. If already sure no such directory exists, then this is safe to set for improved performance.
-
getWriteMode
public abstract CreateFileOptions.WriteMode getWriteMode()
Whether to overwrite an existing file with the same name.
-
getOverwriteGenerationId
public abstract long getOverwriteGenerationId()
Generation of existing object to overwrite. Ignored if set toStorageResourceId.UNKNOWN_GENERATION_ID, but otherwise this is used instead ofoverwriteExisting, where 0 indicates no existing object, and otherwise an existing object will only be overwritten by the newly created file if its generation matches this provided generationId.
-
-