Class FileSystemApi
java.lang.Object
nl.bimbase.bimworks.client.apis.SubApi
nl.bimbase.bimworks.client.apis.FileSystemApi
BIM.works Repository maintains a virtual file system. The API calls in this namespace allow you to manipulate this.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAn open interactive listing: the initial snapshot plus a handle that stops the pushes.static interfaceReceives the tree changes the server pushes on an interactive listing. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintRemove all Nodes of this currently authenticated Account or API Token, be careful! Requires the ADVANCED_SETTINGS user feature on the authenticated Account (for an API Token, the Account that owns it) — without it the server refuses with USER_FEATURE_REQUIRED.intclearNodeChildren(UUID nodeUuid) Remove all child Nodes of the given Node recursively, be careful! The Node itself is kept.createNode(UUID parentNodeUuid, String name, boolean isFolder) Create a new NodecreateNode(UUID parentNodeUuid, String name, boolean isFolder, nl.bimbase.bimworks.api.upload.InputFileType inputFileType) Create a new NodecreateNodeIfNotExists(UUID parentNodeUuid, String name, boolean isFolder, nl.bimbase.bimworks.api.upload.InputFileType inputFileType) Create a new Node if it does not already exists.voiddeleteNode(UUID nodeUuid) Delete a Node based on its UUID if it exists, will throw an exception when a Node already existsvoiddeleteNodeError(UUID nodeUuid, UUID errorUuid) Delete an ErrorvoiddeleteNodeIfExists(String path) Delete a Node based on it's path if it exists, does not throw an exception for non-existing pathsvoiddeleteNodeVersion(UUID nodeUuid, UUID versionUuid) Delete a specific VersiondownloadAsZip(UUID nodeUuid, boolean includeDeleted) Download a folder Node as a ZIP archive holding the last Version of every (non-deleted) Node below it, with the folder structure as entry paths.booleangetNodeByPath(String path) Get a Node by it's pathgetNodeByUuid(UUID nodeUuid) Get a Node by it's UUIDgetNodeByVersionUuid(UUID versionUuid) Get the Node the given Version belongs to.getNodeVersion(UUID versionUuid) Get a Versioncom.fasterxml.jackson.databind.node.ArrayNodegetNodeVersions(Set<UUID> versionUuids) The version records of the given versions (across nodes).com.fasterxml.jackson.databind.node.ArrayNodelistNodeErrors(UUID nodeUuid) List all the errors on a given Nodecom.fasterxml.jackson.databind.node.ObjectNodeList all the child Nodes on the given pathcom.fasterxml.jackson.databind.node.ObjectNodeList all child nodes of the given NodelistNodesInteractive(UUID parentNodeUuid, FileSystemApi.TreeChangeListener listener) List a folder the way the web UI does: the listing stays open and the server pushes every change under it (new versions, checkin progress, errors, renames) until the subscription is closed.com.fasterxml.jackson.databind.node.ObjectNodelistNodesRecursive(UUID nodeUuid) List all Nodes below the given Node.com.fasterxml.jackson.databind.node.ArrayNodelistNodeVersions(UUID nodeUuid) List all the Versions of the given NodevoidMove a Node into another folder.voidrenameNode(UUID nodeUuid, String newName) Rename an existing NodevoidundeleteNode(UUID nodeUuid) Undelete a NodeMethods inherited from class SubApi
getBimWorksClient
-
Constructor Details
-
FileSystemApi
-
-
Method Details
-
createNode
Create a new Node- Parameters:
parentNodeUuid- The UUID of the node the new Node should become a child ofname- The name of the new NodeisFolder- Whether the new Node is a folder or not- Returns:
- The UUID of the new Node
- Throws:
BimWorksException
-
createNode
public UUID createNode(UUID parentNodeUuid, String name, boolean isFolder, nl.bimbase.bimworks.api.upload.InputFileType inputFileType) throws BimWorksException Create a new Node- Parameters:
parentNodeUuid- The UUID of the node the new Node should become a child ofname- The name of the new NodeisFolder- Whether the new Node is a folder or notinputFileType- The type of the Model- Returns:
- Throws:
BimWorksException
-
deleteNodeIfExists
Delete a Node based on it's path if it exists, does not throw an exception for non-existing paths- Parameters:
path- The path to the Node to delete. Keep in mind that paths are relative to your (potential) API Token.- Throws:
BimWorksException
-
deleteNode
Delete a Node based on its UUID if it exists, will throw an exception when a Node already exists- Parameters:
nodeUuid- The UUID of the Node to delete. Keep in mind that paths are relative to your (potential) API Token.- Throws:
BimWorksException
-
renameNode
Rename an existing Node- Parameters:
nodeUuid- The UUID of the Node to renamenewName- The new name of the Node- Throws:
BimWorksException
-
moveNode
Move a Node into another folder. The Node keeps its name. The target must be a folder that does not already contain a node with that name, and a Node cannot be moved onto itself — those cases are rejected by the server with a typed error.- Parameters:
nodeUuid- The UUID of the Node to movetargetParentNodeUuid- The UUID of the folder Node to move it into- Throws:
BimWorksException
-
deleteNodeVersion
Delete a specific Version- Parameters:
nodeUuid-versionUuid-- Throws:
BimWorksException
-
deleteNodeError
Delete an Error- Parameters:
nodeUuid- The Node UUID, this is a redundant argument and will be removed in the futureerrorUuid- The Error UUID- Throws:
BimWorksException
-
undeleteNode
Undelete a Node- Parameters:
nodeUuid- The UUID of the Node to undelete- Throws:
BimWorksException
-
getRootNode
- Returns:
- The root Node
- Throws:
BimWorksException
-
createNodeIfNotExists
public UUID createNodeIfNotExists(UUID parentNodeUuid, String name, boolean isFolder, nl.bimbase.bimworks.api.upload.InputFileType inputFileType) throws BimWorksException Create a new Node if it does not already exists. Does not throw an exception when a Node already exists and instead returns the UUID of the existing Node.- Parameters:
parentNodeUuid- The UUID of the parent Nodename- The name of the new NodeisFolder- Whether the new Node is a folderinputFileType- The type of Node- Returns:
- The UUID of the newly created Node, or the UUID of the existing Node
- Throws:
BimWorksException
-
getNodeByUuid
Get a Node by it's UUID- Parameters:
nodeUuid- The UUID of the requested Node- Returns:
- A Node
- Throws:
BimWorksException
-
getNodeVersion
Get a Version- Parameters:
versionUuid- The UUID of the requested Version- Returns:
- A Version
- Throws:
BimWorksException
-
getNodeByVersionUuid
Get the Node the given Version belongs to.- Parameters:
versionUuid- The UUID of the Version- Returns:
- A Node
- Throws:
BimWorksException
-
listNodes
public com.fasterxml.jackson.databind.node.ObjectNode listNodes(UUID nodeUuid, boolean includeDeletedNodes) throws BimWorksException List all child nodes of the given Node- Parameters:
nodeUuid- The UUID of the given NodeincludeDeletedNodes- Whether to include deleted Nodes. This option requires SUPER_ADMIN privileges at the moment.- Returns:
- Throws:
BimWorksException
-
listNodeErrors
public com.fasterxml.jackson.databind.node.ArrayNode listNodeErrors(UUID nodeUuid) throws BimWorksException List all the errors on a given Node- Parameters:
nodeUuid- The UUID of the given Node- Returns:
- An ArrayNode of all Errors
- Throws:
BimWorksException
-
listNodeVersions
public com.fasterxml.jackson.databind.node.ArrayNode listNodeVersions(UUID nodeUuid) throws BimWorksException List all the Versions of the given Node- Parameters:
nodeUuid- UUID of the given Node- Returns:
- An ArrayNode of Version
- Throws:
BimWorksException
-
listNodesRecursive
public com.fasterxml.jackson.databind.node.ObjectNode listNodesRecursive(UUID nodeUuid) throws BimWorksException List all Nodes below the given Node. Lists all subnodes recursively but the returned data structure is a flat list.- Parameters:
nodeUuid-- Returns:
- Throws:
BimWorksException
-
getNodeByPath
Get a Node by it's path- Parameters:
path- The path- Returns:
- The Node if found
- Throws:
BimWorksException
-
exists
- Parameters:
path- The path to check- Returns:
- Whether a Node exists on the given path
- Throws:
BimWorksException
-
getRootNodeUuid
- Returns:
- The UUID of the root node of the current context. The context depends on the type of authentication. For Username/Password authentication this is always the root Account Node. For API Tokens this is always the Node on which the API Token was created.
- Throws:
BimWorksException
-
clearNodeChildren
Remove all Nodes of this currently authenticated Account or API Token, be careful! Requires the ADVANCED_SETTINGS user feature on the authenticated Account (for an API Token, the Account that owns it) — without it the server refuses with USER_FEATURE_REQUIRED.- Returns:
- The amount of deleted Nodes, counted recursively — folders and already-deleted Nodes included
- Throws:
BimWorksException
-
clearNodeChildren
Remove all child Nodes of the given Node recursively, be careful! The Node itself is kept. Requires the ADVANCED_SETTINGS user feature on the authenticated Account (for an API Token, the Account that owns it) — without it the server refuses with USER_FEATURE_REQUIRED.- Parameters:
nodeUuid- The UUID of the Node whose children are deleted- Returns:
- The amount of deleted Nodes, counted recursively — folders and already-deleted Nodes included
- Throws:
BimWorksException
-
downloadAsZip
Download a folder Node as a ZIP archive holding the last Version of every (non-deleted) Node below it, with the folder structure as entry paths. The archive is generated on the fly: the server pushes the stream descriptor up front and then streams the ZIP into it, so bytes arrive while generation is still running.- Parameters:
nodeUuid- The UUID of the folder Node to downloadincludeDeleted- Whether deleted Nodes are included- Returns:
- An InputStream with the ZIP content. Responsibility for closing this stream is on the caller.
- Throws:
BimWorksException- when the node is not a folder, on missing read rights, or when no stream arrives
-
listNodes
public com.fasterxml.jackson.databind.node.ObjectNode listNodes(String path, boolean includeDeletedNodes) throws BimWorksException List all the child Nodes on the given path- Parameters:
path- The path to the given NodeincludeDeletedNodes- Whether to include deleted Nodes. This option requires SUPER_ADMIN privileges at the moment.- Returns:
- Throws:
BimWorksException
-
listNodesInteractive
public FileSystemApi.NodeSubscription listNodesInteractive(UUID parentNodeUuid, FileSystemApi.TreeChangeListener listener) throws BimWorksException List a folder the way the web UI does: the listing stays open and the server pushes every change under it (new versions, checkin progress, errors, renames) until the subscription is closed. A browser tab holds one of these per open folder.- Parameters:
parentNodeUuid- the folder, null for the root- Throws:
BimWorksException
-
getNodeVersions
public com.fasterxml.jackson.databind.node.ArrayNode getNodeVersions(Set<UUID> versionUuids) throws BimWorksException The version records of the given versions (across nodes).- Throws:
BimWorksException
-