public class BatchFileCreateInfo extends Object implements Serializable
The following table illustrates the use of the overwrite
and enableVersioning
flags and how they
effect the outcome when there is or is not an existing file at the location specified. The red background indicates
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 un-versioned file created |
FALSE | TRUE | New versioned file created | |
TRUE | FALSE | New un-versioned file created | |
TRUE | TRUE | New versioned file created | |
un-versioned 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 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 when creating a new versioned 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 newly created files if
enableVersioning is true. |
boolean |
isEnableVersioning()
Indicates whether new files created should maintain versions.
|
boolean |
isOverwrite()
Indicates whether existing un-versioned 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 when updating an existing versioned file.
|
void |
setCustomVersionForNewFiles(String customVersionForNewFiles)
Sets the custom version number to use when creating a new versioned file.
|
void |
setEnableVersioning(boolean enableVersioning)
Sets the Boolean value that indicates whether new files created should maintain versions.
|
void |
setOverwrite(boolean overwrite)
Sets the Boolean value that indicates whether existing un-versioned files should be 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 newly created files if
enableVersioning is true. |
public BatchFileCreateInfo(String path, SourceLocation location)
path
- The path defining where one or files will be created. This could include a prefix to a file as in
StandardsService.exportStandardToDataSets(String, com.sas.lsaf.core.EntityStatus, String, BatchFileCreateInfo)
.location
- The location of the file: the repository or the workspace.public BatchFileCreateInfo(String parentPath, String name, SourceLocation location)
parentPath
- The parent path defining where one or files will be created.name
- The name of the container in which the files will be created or a prefix for created files.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 boolean isEnableVersioning()
public void setEnableVersioning(boolean enableVersioning)
true
will cause the new file
created to maintain versions by default. Setting it to false
will cause the file created to be
un-versioned. If a file already exists at the specified path then setting this 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
in that
case, 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. Setting this to false
means an exists exception
will be thrown. If no file exists or a versioned file exists at the specified path then setting this attribute
has no effect.overwrite
- The Boolean value that indicates whether existing un-versioned files should be 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. Default is MAJOR
.enableVersioning
is true.public void setVersionTypeForNewFiles(VersionType versionTypeForNewFiles)
enableVersioning
is true. Default is MAJOR
.versionTypeForNewFiles
- The method to generate the first version of newly 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 when updating an existing versioned filepublic 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)
Copyright (c) 2020, SAS Institute Inc., Cary, NC, USA