public class BatchFileCreateInfo extends Object implements Serializable
The following table illustrates the use of the overwrite
and enableVersioning
flags and the effect
that they have on the outcome when there is or is not an existing file at the location specified. The red background
indicates that the flag has no effect on the combination of factors, the green means it is directly related to the
results.
file existence | overwrite | enableVersioning | results |
---|---|---|---|
no file | FALSE | FALSE | New unversioned file created |
FALSE | TRUE | New versioned file created | |
TRUE | FALSE | New unversioned file created | |
TRUE | TRUE | New versioned file created | |
unversioned file exists | FALSE | FALSE | Exists exception |
FALSE | TRUE | Exists exception | |
TRUE | FALSE | File content updated in place | |
TRUE | TRUE | File content updated in place | |
versioned file exists | FALSE | FALSE | New version created |
FALSE | TRUE | New version created | |
TRUE | FALSE | New version created | |
TRUE | TRUE | New version created |
Constructor and Description |
---|
BatchFileCreateInfo(String path,
SourceLocation location)
Constructor.
|
BatchFileCreateInfo(String parentPath,
String name,
SourceLocation location)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
BatchFileCreateInfo |
comment(String comment) |
BatchFileCreateInfo |
enableVersioning() |
BatchFileCreateInfo |
enableVersioning(boolean enableVersioning) |
String |
getComment()
Gets the file comment to associate with the new file or new version of the file.
|
String |
getCustomVersionForExistingFiles()
Gets the custom version number to use when updating an existing versioned file.
|
String |
getCustomVersionForNewFiles()
Gets the custom version number to use to create a new versioned file.
|
String |
getDescription()
Gets the description to add to the new file or new version of the file.
|
SourceLocation |
getLocation()
Gets the location of the file: the repository or the workspace.
|
String |
getPath()
Gets the path defining where one or files will be created.
|
VersionType |
getVersionTypeForExistingFiles()
Gets the method to generate the next version for existing versioned files.
|
VersionType |
getVersionTypeForNewFiles()
Gets the method to generate the first version of created files, if
enableVersioning is true. |
boolean |
isEnableVersioning()
Indicates whether files that are created maintain versions.
|
boolean |
isOverwrite()
Indicates whether existing unversioned files should be overwritten.
|
BatchFileCreateInfo |
overwrite() |
BatchFileCreateInfo |
overwrite(boolean overwrite) |
void |
setComment(String comment)
Sets the file comment to associate with the new file or new version of the file.
|
void |
setCustomVersionForExistingFiles(String customVersionForExistingFiles)
Sets the custom version number to use to update an existing versioned file.
|
void |
setCustomVersionForNewFiles(String customVersionForNewFiles)
Sets the custom version number to use when creating a new versioned file.
|
void |
setDescription(String description)
Sets the description of the new file or new version of the file.
|
void |
setEnableVersioning(boolean enableVersioning)
Sets the value that indicates whether files created maintain versions.
|
void |
setOverwrite(boolean overwrite)
Sets the value that indicates whether existing unversioned files are overwritten.
|
void |
setVersionTypeForExistingFiles(VersionType versionTypeForExistingFiles)
Sets the method to generate the next version for existing versioned files.
|
void |
setVersionTypeForNewFiles(VersionType versionTypeForNewFiles)
Gets the method to generate the first version of created files, if
enableVersioning is true. |
public BatchFileCreateInfo(String path, SourceLocation location)
path
- The path in which to create the file. The path can include a prefix to a file, as can be specified
with
exportStandardToDataSets
.location
- The location of the file: the repository or the workspace.public BatchFileCreateInfo(String parentPath, String name, SourceLocation location)
parentPath
- The parent path in which to create the file.name
- The name of the container in which the files are created or a prefix for the files that are created.location
- The location of the file: the repository or the workspace.public String getComment()
public void setComment(String comment)
comment
- The file comment to associate with the new file or new version of the file.public String getDescription()
public void setDescription(String description)
description
- The description of the new file or new version of the file.public boolean isEnableVersioning()
public void setEnableVersioning(boolean enableVersioning)
true
causes the new file created to maintain versions by
default. The value false
will cause the new file to be created unversioned. If a file already exists at
the specified path, the attribute has no effect.enableVersioning
- The Boolean value that indicates whether new files created should maintain versions.public boolean isOverwrite()
public void setOverwrite(boolean overwrite)
true
causes the contents of the
unversioned file to be replaced with the new contents. The file is not re-created, it is the same file but with
new contents. The value false
indicates that when a file exists in the location, an exception is thrown.
If no file exists or a versioned file exists at the specified path, the attribute has no effect.overwrite
- Indicates whether existing unversioned files are overwritten.public VersionType getVersionTypeForExistingFiles()
MINOR
.public void setVersionTypeForExistingFiles(VersionType versionTypeForExistingFiles)
MINOR
.versionTypeForExistingFiles
- The method to generate the next version for existing versioned files.public VersionType getVersionTypeForNewFiles()
enableVersioning
is true. The default is MAJOR
.enableVersioning
is true.public void setVersionTypeForNewFiles(VersionType versionTypeForNewFiles)
enableVersioning
is true. The default is MAJOR
.versionTypeForNewFiles
- The method to generate the first version of created files, if
enableVersioning
is true.public String getCustomVersionForNewFiles()
version type
specified.public void setCustomVersionForNewFiles(String customVersionForNewFiles)
version type
specified.customVersionForNewFiles
- The custom version number to use when creating a new versioned file.public String getCustomVersionForExistingFiles()
version type
specified.public void setCustomVersionForExistingFiles(String customVersionForExistingFiles)
version type
specified.customVersionForExistingFiles
- The custom version number to use to update a versioned file.public SourceLocation getLocation()
public String getPath()
StandardsService.exportStandardToDataSets(String, com.sas.lsaf.core.EntityStatus, String, BatchFileCreateInfo)
.public BatchFileCreateInfo comment(String comment)
public BatchFileCreateInfo enableVersioning()
public BatchFileCreateInfo enableVersioning(boolean enableVersioning)
public BatchFileCreateInfo overwrite()
public BatchFileCreateInfo overwrite(boolean overwrite)
<i>Copyright (c) 2021, SAS Institute Inc., Cary, NC, USA</i>