Class FileSystemApi

java.lang.Object
nl.bimbase.bimworks.client.apis.SubApi
nl.bimbase.bimworks.client.apis.FileSystemApi

public class FileSystemApi extends SubApi
BIM.works Repository maintains a virtual file system. The API calls in this namespace allow you to manipulate this.
  • Constructor Details

  • Method Details

    • createNode

      public UUID createNode(UUID parentNodeUuid, String name, boolean isFolder) throws BimWorksException
      Create a new Node
      Parameters:
      parentNodeUuid - The UUID of the node the new Node should become a child of
      name - The name of the new Node
      isFolder - 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 of
      name - The name of the new Node
      isFolder - Whether the new Node is a folder or not
      inputFileType - The type of the Model
      Returns:
      Throws:
      BimWorksException
    • deleteNodeIfExists

      public void deleteNodeIfExists(String path) throws BimWorksException
      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

      public void deleteNode(UUID nodeUuid) throws BimWorksException
      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

      public void renameNode(UUID nodeUuid, String newName) throws BimWorksException
      Rename an existing Node
      Parameters:
      nodeUuid - The UUID of the Node to rename
      newName - The new name of the Node
      Throws:
      BimWorksException
    • deleteNodeVersion

      public void deleteNodeVersion(UUID nodeUuid, UUID versionUuid) throws BimWorksException
      Delete a specific Version
      Parameters:
      nodeUuid -
      versionUuid -
      Throws:
      BimWorksException
    • deleteNodeError

      public void deleteNodeError(UUID nodeUuid, UUID errorUuid) throws BimWorksException
      Delete an Error
      Parameters:
      nodeUuid - The Node UUID, this is a redundant argument and will be removed in the future
      errorUuid - The Error UUID
      Throws:
      BimWorksException
    • undeleteNode

      public void undeleteNode(UUID nodeUuid) throws BimWorksException
      Undelete a Node
      Parameters:
      nodeUuid - The UUID of the Node to undelete
      Throws:
      BimWorksException
    • getRootNode

      public TreeNode getRootNode() throws BimWorksException
      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 Node
      name - The name of the new Node
      isFolder - Whether the new Node is a folder
      inputFileType - The type of Node
      Returns:
      The UUID of the newly created Node, or the UUID of the existing Node
      Throws:
      BimWorksException
    • getNodeByUuid

      public TreeNode getNodeByUuid(UUID nodeUuid) throws BimWorksException
      Get a Node by it's UUID
      Parameters:
      nodeUuid - The UUID of the requested Node
      Returns:
      A Node
      Throws:
      BimWorksException
    • getNodeVersion

      public TreeNodeVersion getNodeVersion(UUID versionUuid) throws BimWorksException
      Get a Version
      Parameters:
      versionUuid - The UUID of the requested Version
      Returns:
      A Version
      Throws:
      BimWorksException
    • getNodeByVersionUuid

      public TreeNode getNodeByVersionUuid(UUID versionUuid) throws BimWorksException
      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 Node
      includeDeletedNodes - 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

      public TreeNode getNodeByPath(String path) throws BimWorksException
      Get a Node by it's path
      Parameters:
      path - The path
      Returns:
      The Node if found
      Throws:
      BimWorksException
    • exists

      public boolean exists(String path) throws BimWorksException
      Parameters:
      path - The path to check
      Returns:
      Whether a Node exists on the given path
      Throws:
      BimWorksException
    • getRootNodeUuid

      public UUID getRootNodeUuid() throws BimWorksException
      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

      public int clearNodeChildren() throws BimWorksException
      Remove all Nodes of this currently authenticated Account or API Token, be careful!
      Returns:
      The amount of deleted Nodes
      Throws:
      BimWorksException
    • 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 Node
      includeDeletedNodes - Whether to include deleted Nodes. This option requires SUPER_ADMIN privileges at the moment.
      Returns:
      Throws:
      BimWorksException