Package com.thingworx.things.repository
Class FileRepositoryThing
java.lang.Object
com.thingworx.types.NamedObject
com.thingworx.persistence.common.PersistableNamedObject
com.thingworx.entities.RootEntity
com.thingworx.things.Thing
com.thingworx.things.repository.FileRepositoryThing
- All Implemented Interfaces:
ISupportsAccessModifier,IConfigurableObject,INotScriptFriendly,IRepository,ISupportsDeprecation,IDiffableObject,IAlertProvider,IAvatar,IEntityLifeCycleEvent,IEventMetadataProvider,IEventProvider,IPersistable,IPropertyProvider,IServiceMetadataProvider,IServiceProvider,IShapeProvider,ITaggableObject,IDependencyScannableObject,IImportDependencyHandler,IHierarchicalEntity,IEntityDefinition,IPersistableObject<String>,IDesignTimeSecurable,IDesignTimeSecurableEntity,IRunTimeSecurable,IRunTimeSecurableEntity,ISecurable,IVisibilitySecurable,IVisibilitySecurableEntity,IEventProcessor,IAspectContainer,INamedObject,Serializable
@ThingworxExtensionApiClass(since={6,6},
canInstantiate=true)
public class FileRepositoryThing
extends Thing
implements IRepository
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final doublestatic final doublestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.thingworx.things.Thing
_logger, BUILT_IN_PROPERTY_DEFINITIONS, DATASHAPE_INCOMING_LOCAL_PROPERTY_BINDING, DEFAULT_SETTINGS_TABLE, ENTITYLIST_SHAPE, GENERIC_THING_TEMPLATE, NON_PROPERTY_BASED_EVENTS, PROPERTY_EVENTS, TYPE_THINGFields inherited from class com.thingworx.entities.RootEntity
BASIC_PROPERTY_DEFINITIONS, EXCLUDED_ENTITY_TYPES_IN_PROJECTFields inherited from class com.thingworx.types.NamedObject
NAME_COMPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppendToBinaryFile(String path, byte[] data) voidAppendToTextFile(String path, String data) Service Category: Files Service Description: Append to a text file.BrowseDirectory(String path) Service Category: Transfers Service Description: Get a list of files and/or directories on the Edge Thing.BrowseFileSystem(String path) Service Category: Files Service Description: Browse file system for directories and files.voidvoidcomputeChecksum(String path) Deprecated.computeChecksum(String path, String checksumAlgorithm) CreateArchive(String newFileName, String path, String compressionType, String files) Service Category: Compression Service Description: Create an archive/compressed file within this File Repository.voidCreateBinaryFile(String path, byte[] data, Boolean overwrite) CreateFolder(String path) Service Category: Directories Service Description: Create a folder.CreateFolderInParent(String parentFolderPath, String folderName) Service Category: Directories Service Description: Create a folder in a specific location.voidCreateTextFile(String path, String data, Boolean overwrite) Service Category: Files Service Description: Create a text file.CreateZipArchive(String newFileName, String path, String files) Service Category: Compression Service Description: Create a zip file archive within this File Repository.DeleteFile(String path) Service Category: Files Service Description: Delete a file.DeleteFolder(String path) Service Category: Directories Service Description: Delete a folder.ExtractArchive(String archiveFileName, String path, String compressionType) Service Category: Compression Service Description: Extract the contents of an archive within this File Repository.ExtractZipArchive(String zipFileName, String path) Service Category: Compression Service Description: Extract the contents of a zip file archive within this File Repository.FlatExtractArchive(String archiveFileName, String path, String compressionType) Service Category: Services Service Description: Extract all contents of an archive into the specified path within this File Repository.GetDataExportListing(String path) Service Category: Exports Service Description: Lists exported data directories on the given path.Service Category: Directories Service Description: Get directory structure.GetEntityExportListing(String path) Service Category: Exports Service Description: Lists exported entity files on the given path.GetFileChecksum(String path) Deprecated.GetFileChecksum(String path, String checksumAlgorithm) Gets the checksum of a file in this repository, using the cryptographic algorithm whose name was passed into the service as an argument.GetFileInfo(String path) Service Category: Files Service Description: Get file info.GetFileListing(String path, String nameMask) Service Category: Files Service Description: Get file system listing.GetFileListingWithLinks(String path, String nameMask) Service Category: Files Service Description: Get file system listing with download links.getFileSize(String path) ListDirectories(String path, String nameMask) Service Category: Transfers Service Description: Get list of directories.Service Category: Transfers Service Description: Get file system listing.byte[]LoadBinary(String path) Service Category: Files Service Description: Load binary content from a file.byte[]Service Category: Files Service Description: Load image content from a file.org.json.JSONObjectService Category: Files Service Description: Load JSON from a file.Service Category: Files Service Description: Load Text from a file.Service Category: Files Service Description: Load XML from a file.voidService Category: Files Service Description: Move a file.openFileForRead(String path) openFileForWrite(String path, FileRepositoryThing.FileMode mode) ReadFromBinaryFile(String path, Double offset, Integer count) voidRenameFile(String path, String name, Boolean overwrite) Service Category: Files Service Description: Rename a file.SaveBinary(String path, byte[] content) Service Category: Files Service Description: Save binary data to a file.Service Category: Files Service Description: Save image data to a file.Service Category: Files Service Description: Save JSON to a file.Service Category: Files Service Description: Save text to a file.Service Category: Files Service Description: Save XML to a file.voidStartFileTransfer(String tid, String path, String mode) voidWriteToBinaryFile(String path, Double offset, byte[] data) voidWriteToTextFile(String path, Double offset, String data) Service Category: Files Service Description: Write to a text file.Methods inherited from class com.thingworx.things.Thing
AcknowledgeAlert, acknowledgeAlertByProperty, acknowledgeAlertByPropertyAndName, acknowledgeAllAlerts, AcknowledgeAllAlerts, AddBooleanValueStreamEntry, AddBooleanValueStreamEntry, AddDateTimeValueStreamEntry, AddDateTimeValueStreamEntry, AddDynamicSubscription, AddEventDefinition, AddImageValueStreamEntry, AddImageValueStreamEntry, AddInfoTableValueStreamEntry, AddInfoTableValueStreamEntry, AddIntegerValueStreamEntry, AddIntegerValueStreamEntry, AddLocationValueStreamEntry, AddLocationValueStreamEntry, AddLongValueStreamEntry, AddLongValueStreamEntry, AddNumberValueStreamEntry, AddNumberValueStreamEntry, AddOrUpdateAlert, addProperty, AddPropertyDefinition, AddPropertyDefinition, AddPropertyDefinition, AddPropertyDefinition, AddPropertyDefinition, AddPropertyDefinitions, AddPropertyTransformDefinition, AddServiceDefinition, AddServiceDefinition, AddStringValueStreamEntry, AddStringValueStreamEntry, AddTags, AddThingCodeValueStreamEntry, AddThingCodeValueStreamEntry, AddVec2ValueStreamEntry, AddVec2ValueStreamEntry, AddVec3ValueStreamEntry, AddVec3ValueStreamEntry, AddVec4ValueStreamEntry, AddVec4ValueStreamEntry, checkDemandRead, checkPropertyName, checkValueStream, cleanupThing, DisableAlertsForProperty, DisableAllAlerts, DisableSubscription, DisableSubscription, DisableThing, dispatchBackgroundEvent, dispatchEvent, dispose, EnableAlertsForProperty, EnableAllAlerts, EnableSubscription, EnableSubscription, EnableThing, fireEvent, getAlertConfigurations, GetAlertDefinition, GetAlertDefinitions, getAlerts, getAlertsForProperty, GetAlertStatus, GetAlertStatuses, GetAlertStatusesForProperty, GetAlertSummary, GetAlertSummaryForProperty, GetAllAnomalyAlertTrainingStatistics, getAllImplementedThingShapes, getAllImplementedThingTemplates, GetAnomalyAlertTrainingStatisticsForAlert, GetAnomalyAlertTrainingStatisticsForProperty, GetAvatar, GetBooleanAlertParameter, GetBooleanPropertyValue, GetDateTimeAlertParameter, GetDateTimePropertyValue, getDependencies, getEffectiveAlertConfiguration, getEffectiveAlertDefinition, getEffectiveEventDefinition, getEffectiveIdentifier, GetEffectiveLocalPropertyBinding, getEffectiveLocalPropertyBindings, GetEffectiveLocalPropertyBindings, getEffectivePropertyDefinition, GetEffectivePropertyLogging, getEffectiveRemoteEventBindings, getEffectiveRemotePropertyBindings, getEffectiveRemoteServiceBindings, getEffectiveServiceDefinition, getEffectiveValueStreamName, getEntityType, GetHomeMashup, getIdentifier, GetIdentifier, GetImagePropertyValue, GetImplementedShapes, getImplementedThingTemplates, GetIncomingLocalPropertyBinding, GetIncomingLocalPropertyBindings, getInstanceEventDefinition, getInstanceEventDefinitions, getInstanceMultiEventSubscriptions, getInstancePropertyDefinition, getInstancePropertyDefinitionIfVisible, getInstancePropertyDefinitions, getInstancePublicServiceDefinitions, getInstanceServiceDefinition, getInstanceServiceDefinitions, getInstanceShape, getInstanceSubscriptions, GetIntegerAlertParameter, GetIntegerPropertyValue, GetLocalAlertDefinitions, GetLocallyImplementedShapes, GetLocalPropertyBinding, GetLocationAlertParameter, GetLocationPropertyValue, GetLoggedProperties, GetLongAlertParameter, GetLongPropertyValue, GetMashups, GetNamedProperties, GetNamedPropertyValues, GetNamedPropertyValuesVTQ, GetNamedPropertyValuesVTQA, GetNetworks, GetNumberAlertParameter, GetNumberPropertyValue, GetNumericLoggedProperties, getProperties, getProperty, getPropertyAckStatus, getPropertyAlertStatus, GetPropertyLogging, getPropertyQuality, GetPropertyQuality, getPropertyTime, GetPropertyTime, getPropertyType, getPropertyValue, getPropertyValue, getPropertyValues, GetPropertyValues, getPropertyValuesAsInfoTable, GetPropertyValuesAsMultiRowTable, GetPropertyValuesVTQ, GetPropertyValuesVTQA, GetPublished, GetRemoteEventBinding, GetRemotePropertyBinding, GetRemoteServiceBinding, getState, GetStringAlertParameter, GetStringPropertyValue, GetThingCodePropertyValue, GetThingGroupDelegatedVisibilityPermissions, GetThingRelationships, GetThingSummaryInformation, getThingTemplate, GetThingTemplate, getThingTemplateName, GetValueStream, getValueStreamName, GetVec2PropertyValue, GetVec3PropertyValue, GetVec4PropertyValue, HasAlert, hasEventDefinition, hasLocalEventDefinition, hasLocalPropertyDefinition, hasLocalServiceDefinition, hasProperty, hasPropertyAndIsVisible, hasPropertyDefinition, hasServiceDefinition, HavePropertiesChangedSince, implementsShape, ImplementsShape, implementsTemplate, initializeEntity, initializeProperty, initializeThing, isAlwaysAvailableService, isBuiltInEvent, isBuiltInProperty, IsDerivedFromTemplate, IsDynamicSubscriptionCreated, isEnabled, IsEnabled, isEventRemote, isExternallySubscribed, IsInNetwork, isLocallySubscribed, isLocalProperty, isPropertyEvent, isPropertyRemote, isPublished, isRunning, isServiceRemote, isSubscribed, preprocessSetPropertyVTQ, processAPIServiceRequest, processServiceRequest, processStartNotification, PurgeAllPropertyHistory, PurgePropertyHistory, PurgeSelectedPropertyHistory, QueryAlertHistory, QueryAlertSummary, QueryBooleanPropertyHistory, QueryBooleanPropertyHistory, QueryDateTimePropertyHistory, QueryDateTimePropertyHistory, QueryImagePropertyHistory, QueryImagePropertyHistory, QueryInfoTablePropertyHistory, QueryInfoTablePropertyHistory, QueryIntegerPropertyHistory, QueryIntegerPropertyHistory, QueryLocationPropertyHistory, QueryLocationPropertyHistory, QueryLongPropertyHistory, QueryLongPropertyHistory, QueryNamedPropertyHistory, QueryNamedPropertyHistory, QueryNamedPropertyHistory, QueryNumberPropertyHistory, QueryNumberPropertyHistory, QueryPropertyHistory, QueryPropertyHistory, QueryPropertyHistory, QueryStringPropertyHistory, QueryStringPropertyHistory, QueryThingCodePropertyHistory, QueryThingCodePropertyHistory, QueryVec2PropertyHistory, QueryVec2PropertyHistory, QueryVec3PropertyHistory, QueryVec3PropertyHistory, QueryVec4PropertyHistory, QueryVec4PropertyHistory, QueuePostCommitEvent, RemoveAlert, RemoveDynamicSubscription, RemoveEventDefinition, RemoveLocalPropertyBinding, RemovePropertyDefinition, RemoveRemoteEventBinding, RemoveRemotePropertyBinding, RemoveRemoteServiceBinding, RemoveServiceDefinition, RestartThing, SetBooleanAlertParameter, SetDateTimeAlertParameter, SetDescription, SetIdentifier, SetIntegerAlertParameter, SetLocalPropertyBinding, SetLocalPropertyBinding, SetLocationAlertParameter, SetNumberAlertParameter, SetPropertyLogging, setPropertyValue, SetPropertyValues, setPropertyVTQ, setPropertyVTQ, SetPublished, SetRemoteEventBinding, SetRemotePropertyBinding, SetRemotePropertyBinding, SetRemoteServiceBinding, SetStringAlertParameter, SetTags, setThingTemplateName, SetUnitsForNumericPropertyDefinition, SetValueStream, startThing, stopThing, UpdatePropertyValues, UpdatePropertyValuesBatched, validateConfiguration, WritePropertiesToStreamMethods inherited from class com.thingworx.entities.RootEntity
AddConfigurationTableDefinition, AddConfigurationTableDefinition, addDesignTimePermission, AddDesignTimePermission, addRunTimePermission, AddRunTimePermission, addVisibilityPermission, AddVisibilityPermission, CheckDesignTimePermission, CheckDesignTimePermissionForGroup, CheckDesignTimePermissionForUser, CheckPermission, CheckPermissionForGroup, CheckPermissionForUser, cleanupEntity, DeleteAllConfigurationTableRows, DeleteConfigurationTable, DeleteConfigurationTableRows, DeleteConfigurationTableRows, deleteDesignTimePermission, DeleteDesignTimePermission, deleteRunTimePermission, DeleteRunTimePermission, deleteVisibilityPermission, DeleteVisibilityPermission, getAspects, getAvatarContent, GetAvatarURL, GetConfigurationChangeHistory, getConfigurationSetting, getConfigurationTable, GetConfigurationTable, GetConfigurationTableDefinition, GetConfigurationTableRow, GetConfigurationTables, GetDescription, getDesignTimePermissions, GetDesignTimePermissions, GetDesignTimePermissionsAsJSON, getDocumentationContent, getEntityTypeAsString, GetEventDefinition, GetEventDefinitions, GetIncomingDependencies, GetIncomingDependenciesAsNetwork, GetInstanceMetadataAsJSON, GetInstanceMetadataWithPermissionsAsJSON, GetLastModifiedDate, GetMetadata, GetMetadataAsJSON, GetMetadataWithPermissionsAsJSON, GetOutgoingDependencies, GetOutgoingDependenciesAsNetwork, getOwner, GetOwner, GetPermissionsForCurrentUser, GetPermissionsForGroup, GetPermissionsForUser, GetProjectName, GetPropertyDefinition, GetPropertyDefinitions, getRunTimePermissions, GetRunTimePermissions, GetRunTimePermissionsAsJSON, GetServiceDefinition, GetServiceDefinitions, getStringConfigurationSetting, getStringConfigurationSettingWithDefault, GetSummaryInformation, getTags, GetTags, GetTagsAsInfoTable, getVisibilityPermissions, GetVisibilityPermissions, GetVisibilityPermissionsAsJSON, HasIncomingDependencies, HasOutgoingDependencies, isEditable, isEditableExtensionObject, isEditableSystemObject, isExtensionObject, IsMultiRowTable, isOwner, isSystemObject, isThemeObject, isVisible, isVisible, ListDeprecatedUsage, persistDesignTimePermissions, persistRunTimePermissions, persistVisibilityPermissions, preInitializeEntity, RemoveTags, SaveConfigurationTables, SetAvatar, setConfigurationSetting, SetConfigurationTable, SetConfigurationTableRows, setDesignTimePermissions, SetDesignTimePermissionsAsJSON, setDocumentationContent, setExtensionObject, SetHomeMashup, setLastModifiedDate, SetMultiRowConfigurationTable, setOwner, SetOwner, SetProjectName, setRunTimePermissions, SetRunTimePermissionsAsJSON, setStringConfigurationSetting, setVisibilityPermissions, SetVisibilityPermissionsAsJSON, toJSON, toJSONDefinition, UpdateProjectDependenciesMethods inherited from class com.thingworx.persistence.common.PersistableNamedObject
getID, hasID, isTransientMethods inherited from class com.thingworx.types.NamedObject
getDescription, getName, setDescription, setName, toValueCollectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.thingworx.types.INamedObject
getDescriptionMethods inherited from interface com.thingworx.entities.interfaces.IPersistable
getID, hasIDMethods inherited from interface com.thingworx.security.permissions.ISecurable
getID, getNameMethods inherited from interface com.thingworx.entities.interfaces.IShapeProvider
getNameMethods inherited from interface com.thingworx.accesscontrol.ISupportsAccessModifier
getAccessModifier, getAccessModifierScope, getExemptList, hasAccessModifier, isInternalAccess, isPrivateAccess, isRestrictedAccessMethods inherited from interface com.thingworx.deprecation.ISupportsDeprecation
getDeprecated, isDeprecated, isDeprecatedBefore, since
-
Field Details
-
THINGWORX_FILE_REPOS_PATH
- See Also:
-
DIRECTORY_DATASHAPE
- See Also:
-
FILE_DATASHAPE
- See Also:
-
FILE_DATASHAPE_WITH_LINKS
- See Also:
-
IBM_ENCODING
- See Also:
-
BUFFER_SIZE
public static final int BUFFER_SIZE- See Also:
-
DEFAULT_TRANSFER_BLOCK_SIZE
public static final double DEFAULT_TRANSFER_BLOCK_SIZE- See Also:
-
DEFAULT_MAX_FILE_SIZE
public static final double DEFAULT_MAX_FILE_SIZE- See Also:
-
-
Constructor Details
-
FileRepositoryThing
public FileRepositoryThing()Initializes this instace with default values.
-
-
Method Details
-
GetDirectoryStructure
- Service Category:
- Directories
- Service Description:
- Get directory structure.
- Returns:
- result Directory Results - INFOTABLE - Aspects {dataShape:FileSystemDirectory}
- Throws:
Exception- if an error occurs
-
GetTransferInfo
- Returns:
- result File Results - INFOTABLE - Aspects {dataShape:GetTransferInfoResult}
- Throws:
Exception- if an error occurs
-
GetFileInfo
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetFileInfo(String path) throws Exception - Service Category:
- Files
- Service Description:
- Get file info.
- Parameters:
path- File path - STRING- Returns:
- result File Results - INFOTABLE - Aspects {dataShape:FileSystemFile}
- Throws:
Exception- if an error occurs
-
GetFileChecksum
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4,0}) public String GetFileChecksum(String path) throws Exception Deprecated.- Throws:
Exception
-
GetFileChecksum
@ThingworxExtensionApiMethod(since={8,4}) public String GetFileChecksum(String path, String checksumAlgorithm) throws Exception Gets the checksum of a file in this repository, using the cryptographic algorithm whose name was passed into the service as an argument. Supported checksum algorithms can be gotten using the GetSupportedChecksumAlgorithms service.- Parameters:
path- The path to the file to conduct a checksum onchecksumAlgorithm- The name of the checksum algorithm to use- Returns:
- The checksum of the indicated file
- Throws:
Exception- Thrown if the cryptographic algorithm provided is invalid or is not recognized by the server
-
GetSupportedFileChecksumAlgorithms
@ThingworxExtensionApiMethod(since={8,4}) public InfoTable GetSupportedFileChecksumAlgorithms() throws Exception- Returns:
- result The checksum of the file using the given algorithm - INFOTABLE - Aspects {dataShape:ChecksumAlgorithmList}
- Throws:
Exception- if an error occurs
-
GetFileListing
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetFileListing(String path, String nameMask) throws Exception - Service Category:
- Files
- Service Description:
- Get file system listing.
- Parameters:
path- Directory path - STRINGnameMask- Name mask - STRING- Returns:
- result File Results - INFOTABLE - Aspects {dataShape:FileSystemFile}
- Throws:
Exception- if an error occurs
-
ListFiles
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable ListFiles(String path, String nameMask) throws Exception - Service Category:
- Transfers
- Service Description:
- Get file system listing.
- Parameters:
path- Directory path - STRINGnameMask- Name mask - STRING- Returns:
- result File Results - INFOTABLE - Aspects {dataShape:FileSystemFile}
- Throws:
Exception- if an error occurs
-
ListDirectories
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable ListDirectories(String path, String nameMask) throws Exception - Service Category:
- Transfers
- Service Description:
- Get list of directories.
- Parameters:
path- Directory path - STRINGnameMask- Name mask - STRING- Returns:
- result Directory Results - INFOTABLE - Aspects {dataShape:FileSystemDirectory}
- Throws:
Exception- if an error occurs
-
BrowseFileSystem
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable BrowseFileSystem(String path) throws Exception - Service Category:
- Files
- Service Description:
- Browse file system for directories and files.
- Parameters:
path- Directory path - STRING- Returns:
- result File Results - INFOTABLE - Aspects {dataShape:FileSystemFile}
- Throws:
Exception- if an error occurs
-
BrowseDirectory
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable BrowseDirectory(String path) throws Exception - Service Category:
- Transfers
- Service Description:
- Get a list of files and/or directories on the Edge Thing.
- Parameters:
path- Directory path - STRING- Returns:
- result Browse Results - INFOTABLE - Aspects {dataShape:FileSystemFile}
- Throws:
Exception- if an error occurs
-
GetFileListingWithLinks
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetFileListingWithLinks(String path, String nameMask) throws Exception - Service Category:
- Files
- Service Description:
- Get file system listing with download links.
- Parameters:
path- Directory path - STRINGnameMask- Name mask - STRING- Returns:
- result File Results - INFOTABLE - Aspects {dataShape:FileSystemFileWithLinks}
- Throws:
Exception- if an error occurs
-
StartFileTransfer
@ThingworxExtensionApiMethod(since={6,6}) public void StartFileTransfer(String tid, String path, String mode) throws Exception - Parameters:
tid- Transfer Id - STRINGpath- File path - STRINGmode- Indicates if the file will be open in 'read' or 'write' mode - STRING- Throws:
Exception- if an error occurs
-
CompleteFileTransfer
@ThingworxExtensionApiMethod(since={6,6}) public void CompleteFileTransfer(InfoTable job) throws Exception - Parameters:
job- The transfer job being completed - INFOTABLE- Throws:
Exception- if an error occurs
-
CancelFileTransfer
@ThingworxExtensionApiMethod(since={6,6}) public void CancelFileTransfer(InfoTable job) throws Exception - Parameters:
job- The transfer job being completed - INFOTABLE- Throws:
Exception- if an error occurs
-
CreateBinaryFile
@ThingworxExtensionApiMethod(since={6,6}) public void CreateBinaryFile(String path, byte[] data, Boolean overwrite) throws Exception - Parameters:
path- File path - STRINGdata- Initial data - BLOBoverwrite- Overwrite existing file - BOOLEAN- Throws:
Exception- if an error occurs
-
CreateTextFile
@ThingworxExtensionApiMethod(since={6,6}) public void CreateTextFile(String path, String data, Boolean overwrite) throws Exception - Service Category:
- Files
- Service Description:
- Create a text file.
- Parameters:
path- File path - STRINGdata- Initial data - STRINGoverwrite- Overwrite existing file - BOOLEAN- Throws:
Exception- if an error occurs
-
ReadFromBinaryFile
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable ReadFromBinaryFile(String path, Double offset, Integer count) throws Exception - Parameters:
path- File path - STRINGoffset- File offset in bytes - NUMBERcount- Number of bytes to read - INTEGER- Returns:
- result File Read Results - INFOTABLE - Aspects {dataShape:ReadFromBinaryFileResult}
- Throws:
Exception- if an error occurs
-
AppendToBinaryFile
@ThingworxExtensionApiMethod(since={6,6}) public void AppendToBinaryFile(String path, byte[] data) throws Exception - Parameters:
path- File path - STRINGdata- Initial data - BLOB- Throws:
Exception- if an error occurs
-
WriteToBinaryFile
@ThingworxExtensionApiMethod(since={6,6}) public void WriteToBinaryFile(String path, Double offset, byte[] data) throws Exception - Parameters:
path- File path - STRINGoffset- File offset in bytes - NUMBERdata- Initial data - BLOB- Throws:
Exception- if an error occurs
-
WriteToTextFile
@ThingworxExtensionApiMethod(since={6,6}) public void WriteToTextFile(String path, Double offset, String data) throws Exception - Service Category:
- Files
- Service Description:
- Write to a text file.
- Parameters:
path- File path - STRINGoffset- File offset in bytes - NUMBERdata- Initial data - STRING- Throws:
Exception- if an error occurs
-
AppendToTextFile
@ThingworxExtensionApiMethod(since={6,6}) public void AppendToTextFile(String path, String data) throws Exception - Service Category:
- Files
- Service Description:
- Append to a text file.
- Parameters:
path- File path - STRINGdata- Initial data - STRING- Throws:
Exception- if an error occurs
-
RenameFile
@ThingworxExtensionApiMethod(since={6,6}) public void RenameFile(String path, String name, Boolean overwrite) throws Exception - Service Category:
- Files
- Service Description:
- Rename a file.
- Parameters:
path- File path - STRINGname- New file name - STRINGoverwrite- Overwrite existing file - BOOLEAN- Throws:
Exception- if an error occurs
-
MoveFile
@ThingworxExtensionApiMethod(since={6,6}) public void MoveFile(String sourcePath, String targetPath, Boolean overwrite) throws Exception - Service Category:
- Files
- Service Description:
- Move a file.
- Parameters:
sourcePath- Path of file to move - STRINGtargetPath- Path of target file - STRINGoverwrite- Overwrite existing file - BOOLEAN- Throws:
Exception- if an error occurs
-
DeleteFile
- Service Category:
- Files
- Service Description:
- Delete a file.
- Parameters:
path- File path - STRING- Throws:
Exception- if an error occurs
-
CreateFolderInParent
@ThingworxExtensionApiMethod(since={6,6}) public Boolean CreateFolderInParent(String parentFolderPath, String folderName) throws Exception - Service Category:
- Directories
- Service Description:
- Create a folder in a specific location.
- Parameters:
parentFolderPath- Parent folder full path - STRINGfolderName- New Folder to be created - STRING- Throws:
Exception- if an error occurs
-
CreateFolder
- Service Category:
- Directories
- Service Description:
- Create a folder.
- Parameters:
path- Folder path - STRING- Throws:
Exception- if an error occurs
-
DeleteFolder
- Service Category:
- Directories
- Service Description:
- Delete a folder.
- Parameters:
path- Folder path - STRING- Throws:
Exception- if an error occurs
-
SaveJSON
@ThingworxExtensionApiMethod(since={6,6}) public Boolean SaveJSON(String path, org.json.JSONObject content) throws Exception - Service Category:
- Files
- Service Description:
- Save JSON to a file.
- Parameters:
path- File path - STRINGcontent- JSON content - JSON- Throws:
Exception- if an error occurs
-
LoadJSON
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject LoadJSON(String path) throws Exception - Service Category:
- Files
- Service Description:
- Load JSON from a file.
- Parameters:
path- File path - STRING- Returns:
- Content Content - JSON
- Throws:
Exception- if an error occurs
-
SaveXML
@ThingworxExtensionApiMethod(since={6,6}) public Boolean SaveXML(String path, Document content) throws Exception - Service Category:
- Files
- Service Description:
- Save XML to a file.
- Parameters:
path- File path - STRINGcontent- XML content - XML- Throws:
Exception- if an error occurs
-
LoadXML
- Service Category:
- Files
- Service Description:
- Load XML from a file.
- Parameters:
path- File path - STRING- Returns:
- Content Content - XML
- Throws:
Exception- if an error occurs
-
SaveText
@ThingworxExtensionApiMethod(since={6,6}) public Boolean SaveText(String path, String content) throws Exception - Service Category:
- Files
- Service Description:
- Save text to a file.
- Parameters:
path- File path - STRINGcontent- Text content - STRING- Throws:
Exception- if an error occurs
-
LoadText
- Service Category:
- Files
- Service Description:
- Load Text from a file.
- Parameters:
path- File path - STRING- Returns:
- Content Content - STRING
- Throws:
Exception- if an error occurs
-
SaveBinary
@ThingworxExtensionApiMethod(since={6,6}) public Boolean SaveBinary(String path, byte[] content) throws Exception - Service Category:
- Files
- Service Description:
- Save binary data to a file.
- Parameters:
path- File path - STRINGcontent- Binary content - BLOB- Throws:
Exception- if an error occurs
-
LoadBinary
- Service Category:
- Files
- Service Description:
- Load binary content from a file.
- Parameters:
path- File path - STRING- Returns:
- Content Content - BLOB
- Throws:
Exception- if an error occurs
-
SaveImage
@ThingworxExtensionApiMethod(since={6,6}) public Boolean SaveImage(String path, byte[] content) throws Exception - Service Category:
- Files
- Service Description:
- Save image data to a file.
- Parameters:
path- File path - STRINGcontent- Binary content - IMAGE- Throws:
Exception- if an error occurs
-
LoadImage
- Service Category:
- Files
- Service Description:
- Load image content from a file.
- Parameters:
path- File path - STRING- Returns:
- Content Content - IMAGE
- Throws:
Exception- if an error occurs
-
CreateZipArchive
@ThingworxExtensionApiMethod(since={6,6}) public Boolean CreateZipArchive(String newFileName, String path, String files) throws Exception - Service Category:
- Compression
- Service Description:
- Create a zip file archive within this File Repository. If specified path does not exist, it will be created inside the File Repository.
- Parameters:
newFileName- Name of zip file to be created - STRINGpath- Path within the File Repository to create the zip file - STRINGfiles- Comma separated list of full path names for files in the repository to add to the archive - STRING- Returns:
- result success or failure of the archive creation - BOOLEAN
- Throws:
Exception- if an error occurs
-
CreateArchive
@ThingworxExtensionApiMethod(since={7,3}) public Boolean CreateArchive(String newFileName, String path, String compressionType, String files) throws Exception - Service Category:
- Compression
- Service Description:
- Create an archive/compressed file within this File Repository. If specified path does not exist, it will be created inside the File Repository.
- Parameters:
newFileName- Name of file to be created - STRINGpath- Path within the File Repository to create the file - STRINGcompressionType- Compression type of archive file (valid types are zip and targz). If not provided, it will default to 'zip' - STRINGfiles- Comma separated list of full path names for files in the repository to add to the archive - STRING- Returns:
- result success or failure of the archive creation - BOOLEAN
- Throws:
Exception- if an error occurs
-
ExtractZipArchive
@ThingworxExtensionApiMethod(since={6,6}) public Boolean ExtractZipArchive(String zipFileName, String path) throws Exception - Service Category:
- Compression
- Service Description:
- Extract the contents of a zip file archive within this File Repository. If specified path does not exist, it will be created.
- Parameters:
zipFileName- Full path of zip file within the File Repository - STRINGpath- Path within the File Repository to extract the zip file contents to - STRING- Returns:
- result success or failure of the extraction - BOOLEAN
- Throws:
Exception- if an error occurs
-
ExtractArchive
@ThingworxExtensionApiMethod(since={7,3}) public Boolean ExtractArchive(String archiveFileName, String path, String compressionType) throws Exception - Service Category:
- Compression
- Service Description:
- Extract the contents of an archive within this File Repository. If specified path does not exist, it will be created.
- Parameters:
archiveFileName- Full path of archive file within the File Repository - STRINGpath- Path within the File Repository to extract the archive file contents to - STRINGcompressionType- Compression type of archive file (valid types are zip and targz). If not provided, it will be derived from newFileName if possible - STRING- Returns:
- result success or failure of the extraction - BOOLEAN
- Throws:
Exception- if an error occurs
-
FlatExtractArchive
@ThingworxExtensionApiMethod(since={8,5}) public Boolean FlatExtractArchive(String archiveFileName, String path, String compressionType) throws Exception - Service Category:
- Services
- Service Description:
- Extract all contents of an archive into the specified path within this File Repository. If the specified path does not exist, it will be created.
- Parameters:
archiveFileName- Full path of archive file within the File Repository - STRINGpath- Path within the File Repository to extract the archive file contents to - STRINGcompressionType- Compression type of archive file (valid types are zip and targz). If not provided, it will be derived from newFileName if possible - STRING- Returns:
- result success or failure of the extraction - BOOLEAN
- Throws:
Exception- if an error occurs
-
getRootPath
- Specified by:
getRootPathin interfaceIRepository
-
getFileSize
-
computeChecksum
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4,0}) public String computeChecksum(String path) throws Exception Deprecated.- Throws:
Exception
-
computeChecksum
@ThingworxExtensionApiMethod(since={8,4}) public String computeChecksum(String path, String checksumAlgorithm) throws Exception - Throws:
Exception
-
openFileForRead
@ThingworxExtensionApiMethod(since={6,6}) public FileInputStream openFileForRead(String path) throws Exception - Throws:
Exception
-
openFileForWrite
@ThingworxExtensionApiMethod(since={6,6}) public FileOutputStream openFileForWrite(String path, FileRepositoryThing.FileMode mode) throws Exception - Throws:
Exception
-
GetDataExportListing
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetDataExportListing(String path) throws Exception - Service Category:
- Exports
- Service Description:
- Lists exported data directories on the given path.
- Parameters:
path- File Repository Relative Path - STRING- Returns:
- result Returns lists of exported data directories on the given path - INFOTABLE - Aspects {dataShape:ExportFile}
- Throws:
Exception- if an error occurs
-
GetEntityExportListing
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetEntityExportListing(String path) throws Exception - Service Category:
- Exports
- Service Description:
- Lists exported entity files on the given path.
- Parameters:
path- File Repository Relative Path - STRING- Returns:
- result Returns list of exported entity files on the given path - INFOTABLE - Aspects {dataShape:ExportFile}
- Throws:
Exception- if an error occurs
-