public class CreateFileOptions
extends java.lang.Object
GoogleCloudFileSystem.| Modifier and Type | Field and Description |
|---|---|
static CreateFileOptions |
DEFAULT |
static java.lang.String |
DEFAULT_CONTENT_TYPE |
static com.google.common.collect.ImmutableMap<java.lang.String,byte[]> |
EMPTY_ATTRIBUTES |
| Constructor and Description |
|---|
CreateFileOptions(boolean overwriteExisting)
Create a file with empty attributes and optionally overwriting any existing file.
|
CreateFileOptions(boolean overwriteExisting,
java.util.Map<java.lang.String,byte[]> attributes)
Create a file with specified attributes and optionally overwriting an existing file.
|
CreateFileOptions(boolean overwriteExisting,
java.lang.String contentType)
Create a file with empty attributes, and optionally overwriting any existing file with one
having the given content-type.
|
CreateFileOptions(boolean overwriteExisting,
java.lang.String contentType,
java.util.Map<java.lang.String,byte[]> attributes)
Create a file with specified attributes, and optionally overwriting an existing file with one
having the given content-type.
|
CreateFileOptions(boolean overwriteExisting,
java.lang.String contentType,
java.util.Map<java.lang.String,byte[]> attributes,
boolean checkNoDirectoryConflict,
boolean ensureParentDirectoriesExist,
long existingGenerationId)
Create a file with specified attributes, and optionally overwriting an existing file with one
having the given content-type.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkNoDirectoryConflict()
If true, makes sure there isn't already a directory object of the same name.
|
boolean |
ensureParentDirectoriesExist()
If true, ensures parent directories exist, creating them on-demand if they don't.
|
java.util.Map<java.lang.String,byte[]> |
getAttributes()
Extended attributes to set when creating a file.
|
java.lang.String |
getContentType()
Content-type to set when creating a file.
|
long |
getExistingGenerationId()
Generation of existing object.
|
boolean |
overwriteExisting()
Get the value of overwriteExisting.
|
public static final com.google.common.collect.ImmutableMap<java.lang.String,byte[]> EMPTY_ATTRIBUTES
public static final java.lang.String DEFAULT_CONTENT_TYPE
public static final CreateFileOptions DEFAULT
public CreateFileOptions(boolean overwriteExisting)
overwriteExisting - True to overwrite an existing file with the same namepublic CreateFileOptions(boolean overwriteExisting,
java.lang.String contentType)
overwriteExisting - True to overwrite an existing file with the same namecontentType - content-type for the created filepublic CreateFileOptions(boolean overwriteExisting,
java.util.Map<java.lang.String,byte[]> attributes)
overwriteExisting - True to overwrite an existing file with the same nameattributes - File attributes to apply to the file at creationpublic CreateFileOptions(boolean overwriteExisting,
java.lang.String contentType,
java.util.Map<java.lang.String,byte[]> attributes)
overwriteExisting - True to overwrite an existing file with the same namecontentType - content-type for the created fileattributes - File attributes to apply to the file at creationpublic CreateFileOptions(boolean overwriteExisting,
java.lang.String contentType,
java.util.Map<java.lang.String,byte[]> attributes,
boolean checkNoDirectoryConflict,
boolean ensureParentDirectoriesExist,
long existingGenerationId)
overwriteExisting - True to overwrite an existing file with the same namecontentType - content-type for the created fileattributes - File attributes to apply to the file at creationcheckNoDirectoryConflict - 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.ensureParentDirectoriesExist - If true, ensures parent directories exist, creating
them on-demand if they don't. If false, you run the risk of creating objects without
parent directories, which may degrade or break the behavior of some filesystem
functionality. If already sure parent directories exist, then this is safe to set for
improved performance.existingGenerationId - Ignored if set to StorageResourceId.UNKNOWN_GENERATION_ID, but
otherwise this is used instead of overwriteExisting, 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.public boolean overwriteExisting()
public java.lang.String getContentType()
public java.util.Map<java.lang.String,byte[]> getAttributes()
public boolean checkNoDirectoryConflict()
public boolean ensureParentDirectoriesExist()
public long getExistingGenerationId()
overwriteExisting, 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.Copyright © 2019. All rights reserved.