55import java .util .List ;
66import org .apache .http .entity .InputStreamEntity ;
77
8+ /**
9+ * Interface for interacting with Databricks Unity Catalog (UC) Volumes. Provides methods for
10+ * managing and accessing files and directories within UC Volumes, supporting operations such as
11+ * checking existence, listing contents, and performing CRUD (Create, Read, Update, Delete)
12+ * operations on objects stored in volumes.
13+ */
814public interface IDatabricksVolumeClient {
915
1016 /**
11- * prefixExists(): Determines if a specific prefix (folder-like structure) exists in the UC Volume
12- * The prefix that we are looking for must be a part of the file name.
17+ * Checks if a specific prefix (folder-like structure) exists in the UC Volume. The prefix must be
18+ * a part of the file name or path .
1319 *
14- * @param catalog the catalog name of the cloud storage
15- * @param schema the schema name of the cloud storage
16- * @param volume the UC volume name of the cloud storage
17- * @param prefix the prefix to check for existence along with the relative path from the volume as
18- * the root directory
19- * @param caseSensitive a boolean indicating whether the check should be case-sensitive or not
20- * @return a boolean indicating whether the prefix exists or not
20+ * @param catalog the catalog name in Unity Catalog
21+ * @param schema the schema name in the specified catalog
22+ * @param volume the volume name in the specified schema
23+ * @param prefix the prefix to check, including the relative path from the volume root
24+ * @param caseSensitive whether the prefix check should be case-sensitive
25+ * @return true if the prefix exists, false otherwise
26+ * @throws SQLException if a database access error occurs or the volume is inaccessible
2127 */
2228 boolean prefixExists (
2329 String catalog , String schema , String volume , String prefix , boolean caseSensitive )
2430 throws SQLException ;
2531
2632 /**
27- * objectExists(): Determines if a specific object (file) exists in the UC Volume The object that
28- * we are looking for must match the file name exactly
33+ * Checks if a specific object (file) exists in the UC Volume. The object path must exactly match
34+ * an existing file.
2935 *
30- * @param catalog the catalog name of the cloud storage
31- * @param schema the schema name of the cloud storage
32- * @param volume the UC volume name of the cloud storage
33- * @param objectPath the path of the object (file) from the volume as the root directory to check
34- * for existence within the volume (inside any sub-folder)
35- * @param caseSensitive a boolean indicating whether the check should be case-sensitive or not
36- * @return a boolean indicating whether the object exists or not
36+ * @param catalog the catalog name in Unity Catalog
37+ * @param schema the schema name in the specified catalog
38+ * @param volume the volume name in the specified schema
39+ * @param objectPath the path of the object from the volume root
40+ * @param caseSensitive whether the path check should be case-sensitive
41+ * @return true if the object exists, false otherwise
42+ * @throws SQLException if a database access error occurs or the volume is inaccessible
3743 */
3844 boolean objectExists (
3945 String catalog , String schema , String volume , String objectPath , boolean caseSensitive )
4046 throws SQLException ;
4147
4248 /**
43- * volumeExists(): Determines if a specific volume exists in the given catalog and schema. The
44- * volume that we are looking for must match the volume name exactly.
49+ * Checks if a specific volume exists in the given catalog and schema. The volume name must match
50+ * exactly.
4551 *
46- * @param catalog the catalog name of the cloud storage
47- * @param schema the schema name of the cloud storage
48- * @param volumeName the name of the volume to check for existence
49- * @param caseSensitive a boolean indicating whether the check should be case-sensitive or not
50- * @return a boolean indicating whether the volume exists or not
52+ * @param catalog the catalog name in Unity Catalog
53+ * @param schema the schema name in the specified catalog
54+ * @param volumeName the name of the volume to check
55+ * @param caseSensitive whether the volume name check should be case-sensitive
56+ * @return true if the volume exists, false otherwise
57+ * @throws SQLException if a database access error occurs
5158 */
5259 boolean volumeExists (String catalog , String schema , String volumeName , boolean caseSensitive )
5360 throws SQLException ;
5461
5562 /**
56- * listObjects(): Lists all filenames in the UC Volume that start with a specified prefix. The
57- * prefix that we are looking for must be a part of the file path from the volume as the root.
63+ * Lists all objects (files) in the UC Volume that start with a specified prefix. The prefix must
64+ * be a part of the file path from the volume root.
5865 *
59- * @param catalog the catalog name of the cloud storage
60- * @param schema the schema name of the cloud storage
61- * @param volume the UC volume name of the cloud storage
62- * @param prefix the prefix of the filenames to list. This includes the relative path from the
63- * volume as the root directory
64- * @param caseSensitive a boolean indicating whether the check should be case-sensitive or not
65- * @return a list of strings indicating the filenames that start with the specified prefix
66+ * @param catalog the catalog name in Unity Catalog
67+ * @param schema the schema name in the specified catalog
68+ * @param volume the volume name in the specified schema
69+ * @param prefix the prefix to filter objects by, including the relative path from volume root
70+ * @param caseSensitive whether the prefix matching should be case-sensitive
71+ * @return a list of object paths that match the specified prefix
72+ * @throws SQLException if a database access error occurs or the volume is inaccessible
6673 */
6774 List <String > listObjects (
6875 String catalog , String schema , String volume , String prefix , boolean caseSensitive )
6976 throws SQLException ;
7077
7178 /**
72- * getObject(): Retrieves an object (file) from the UC Volume and stores it in the local path
79+ * Downloads an object (file) from the UC Volume to a local path.
7380 *
74- * @param catalog the catalog name of the cloud storage
75- * @param schema the schema name of the cloud storage
76- * @param volume the UC volume name of the cloud storage
77- * @param objectPath the path of the object (file) from the volume as the root directory
78- * @param localPath the local path where the retrieved data is to be stored
79- * @return a boolean value indicating status of the GET operation
81+ * @param catalog the catalog name in Unity Catalog
82+ * @param schema the schema name in the specified catalog
83+ * @param volume the volume name in the specified schema
84+ * @param objectPath the path of the object in the volume
85+ * @param localPath the local filesystem path where the object should be saved
86+ * @return true if the download was successful, false otherwise
87+ * @throws SQLException if a database access error occurs, the volume is inaccessible, or there
88+ * are issues with the local filesystem
8089 */
8190 boolean getObject (
8291 String catalog , String schema , String volume , String objectPath , String localPath )
8392 throws SQLException ;
8493
8594 /**
86- * getObject(): Retrieves an object as input stream from the UC Volume
95+ * Retrieves an object as an input stream from the UC Volume. The caller is responsible for
96+ * closing the returned input stream.
8797 *
88- * @param catalog the catalog name of the cloud storage
89- * @param schema the schema name of the cloud storage
90- * @param volume the UC volume name of the cloud storage
91- * @param objectPath the path of the object (file) from the volume as the root directory
92- * @return an instance of input stream entity
98+ * @param catalog the catalog name in Unity Catalog
99+ * @param schema the schema name in the specified catalog
100+ * @param volume the volume name in the specified schema
101+ * @param objectPath the path of the object in the volume
102+ * @return an InputStreamEntity containing the object's data
103+ * @throws SQLException if a database access error occurs or the volume is inaccessible
93104 */
94105 InputStreamEntity getObject (String catalog , String schema , String volume , String objectPath )
95106 throws SQLException ;
96107
97108 /**
98- * putObject(): Upload data from a local path to a specified path within a UC Volume.
109+ * Uploads data from a local file to a specified path within a UC Volume.
99110 *
100- * @param catalog the catalog name of the cloud storage
101- * @param schema the schema name of the cloud storage
102- * @param volume the UC volume name of the cloud storage
103- * @param objectPath the destination path where the object (file) is to be uploaded from the
104- * volume as the root directory
105- * @param localPath the local path from where the data is to be uploaded
106- * @param toOverwrite a boolean indicating whether to overwrite the object if it already exists
107- * @return a boolean value indicating status of the PUT operation
111+ * @param catalog the catalog name in Unity Catalog
112+ * @param schema the schema name in the specified catalog
113+ * @param volume the volume name in the specified schema
114+ * @param objectPath the destination path in the volume where the file should be uploaded
115+ * @param localPath the local filesystem path of the file to upload
116+ * @param toOverwrite whether to overwrite the object if it already exists
117+ * @return true if the upload was successful, false otherwise
118+ * @throws SQLException if a database access error occurs, the volume is inaccessible, or there
119+ * are issues with the local filesystem
108120 */
109121 boolean putObject (
110122 String catalog ,
@@ -116,17 +128,17 @@ boolean putObject(
116128 throws SQLException ;
117129
118130 /**
119- * putObject(): Upload data from an input stream to a specified path within a UC Volume.
131+ * Uploads data from an input stream to a specified path within a UC Volume.
120132 *
121- * @param catalog the catalog name of the cloud storage
122- * @param schema the schema name of the cloud storage
123- * @param volume the UC volume name of the cloud storage
124- * @param objectPath the destination path where the object (file) is to be uploaded from the
125- * volume as the root directory
126- * @param inputStream the input stream from where the data is to be uploaded
127- * @param contentLength the length of the input stream
128- * @param toOverwrite a boolean indicating whether to overwrite the object if it already exists
129- * @return a boolean value indicating status of the PUT operation
133+ * @param catalog the catalog name in Unity Catalog
134+ * @param schema the schema name in the specified catalog
135+ * @param volume the volume name in the specified schema
136+ * @param objectPath the destination path in the volume where the data should be uploaded
137+ * @param inputStream the input stream containing the data to upload
138+ * @param contentLength the length of the data in bytes
139+ * @param toOverwrite whether to overwrite the object if it already exists
140+ * @return true if the upload was successful, false otherwise
141+ * @throws SQLException if a database access error occurs or the volume is inaccessible
130142 */
131143 boolean putObject (
132144 String catalog ,
@@ -139,13 +151,14 @@ boolean putObject(
139151 throws SQLException ;
140152
141153 /**
142- * deleteObject(): Remove an object from a specified path within a UC Volume
154+ * Deletes an object from a specified path within a UC Volume.
143155 *
144- * @param catalog the catalog name of the cloud storage
145- * @param schema the schema name of the cloud storage
146- * @param volume the UC volume name of the cloud storage
147- * @param objectPath the path of the object (file) from the volume as the root directory to delete
148- * @return a boolean value indicating status of the DELETE operation
156+ * @param catalog the catalog name in Unity Catalog
157+ * @param schema the schema name in the specified catalog
158+ * @param volume the volume name in the specified schema
159+ * @param objectPath the path of the object to delete
160+ * @return true if the deletion was successful, false otherwise
161+ * @throws SQLException if a database access error occurs or the volume is inaccessible
149162 */
150163 boolean deleteObject (String catalog , String schema , String volume , String objectPath )
151164 throws SQLException ;
0 commit comments