11/*
22 * DBeaver - Universal Database Manager
3- * Copyright (C) 2010-2024 DBeaver Corp and others
3+ * Copyright (C) 2010-2025 DBeaver Corp and others
44 *
55 * Licensed under the Apache License, Version 2.0 (the "License");
66 * you may not use this file except in compliance with the License.
1818
1919import io .cloudbeaver .DBWConstants ;
2020import io .cloudbeaver .DBWebException ;
21- import io .cloudbeaver .model .fs .FSUtils ;
21+ import io .cloudbeaver .model .fs .WebFSUtils ;
2222import io .cloudbeaver .model .session .WebSession ;
2323import io .cloudbeaver .service .fs .DBWServiceFS ;
2424import io .cloudbeaver .service .fs .model .FSFile ;
@@ -69,7 +69,7 @@ public FSFileSystem[] getAvailableFileSystems(@NotNull WebSession webSession, @N
6969 }
7070 return Arrays .stream (children )
7171 .map (fs -> new FSFileSystem (
72- FSUtils .makeUniqueFsId (fs .getFileSystem ()),
72+ WebFSUtils .makeUniqueFsId (fs .getFileSystem ()),
7373 fs .getNodeUri (),
7474 fsRegistry .getProvider (fs .getFileSystem ().getProviderId ()).getRequiredAuth ()
7575 )
@@ -94,7 +94,7 @@ public FSFileSystem getFileSystem(
9494 }
9595 var fsRegistry = FileSystemProviderRegistry .getInstance ();
9696 return new FSFileSystem (
97- FSUtils .makeUniqueFsId (fs .getFileSystem ()),
97+ WebFSUtils .makeUniqueFsId (fs .getFileSystem ()),
9898 fs .getNodeUri (),
9999 fsRegistry .getProvider (fs .getFileSystem ().getProviderId ()).getRequiredAuth ()
100100 );
@@ -108,7 +108,7 @@ public FSFileSystem getFileSystem(
108108 public FSFile getFile (@ NotNull WebSession webSession , @ NotNull String nodePath )
109109 throws DBWebException {
110110 try {
111- DBNPathBase node = FSUtils .getNodeByPath (webSession , nodePath );
111+ DBNPathBase node = WebFSUtils .getNodeByPath (webSession , nodePath );
112112 return new FSFile (node );
113113 } catch (Exception e ) {
114114 throw new DBWebException ("Failed to found file: " + e .getMessage (), e );
@@ -120,7 +120,7 @@ public FSFile getFile(@NotNull WebSession webSession, @NotNull String nodePath)
120120 public FSFile [] getFiles (@ NotNull WebSession webSession , @ NotNull String parentPath )
121121 throws DBWebException {
122122 try {
123- DBNPathBase folderPath = FSUtils .getNodeByPath (webSession , parentPath );
123+ DBNPathBase folderPath = WebFSUtils .getNodeByPath (webSession , parentPath );
124124 var children = folderPath .getChildren (webSession .getProgressMonitor ());
125125 if (children == null ) {
126126 return new FSFile [0 ];
@@ -140,7 +140,7 @@ public FSFile[] getFiles(@NotNull WebSession webSession, @NotNull String parentP
140140 public String readFileContent (@ NotNull WebSession webSession , @ NotNull String nodePath )
141141 throws DBWebException {
142142 try {
143- Path filePath = FSUtils .getPathFromNode (webSession , nodePath );
143+ Path filePath = WebFSUtils .getPathFromNode (webSession , nodePath );
144144 var data = Files .readAllBytes (filePath );
145145 return new String (data , StandardCharsets .UTF_8 );
146146 } catch (Exception e ) {
@@ -158,7 +158,7 @@ public FSFile writeFileContent(
158158 throws DBWebException {
159159 validateEditPermissions (webSession );
160160 try {
161- DBNPathBase node = FSUtils .getNodeByPath (webSession , nodePath );
161+ DBNPathBase node = WebFSUtils .getNodeByPath (webSession , nodePath );
162162 Path filePath = node .getPath ();
163163 if (!forceOverwrite ) {
164164 throw new DBException ("Cannot overwrite exist file" );
@@ -179,7 +179,7 @@ public FSFile createFile(
179179 ) throws DBWebException {
180180 validateEditPermissions (webSession );
181181 try {
182- DBNPathBase parentNode = FSUtils .getNodeByPath (webSession , parentPath );
182+ DBNPathBase parentNode = WebFSUtils .getNodeByPath (webSession , parentPath );
183183 if (!Files .isDirectory (parentNode .getPath ())) {
184184 throw new DBException (MessageFormat .format ("Node ''{0}'' is not a directory" , parentPath ));
185185 }
@@ -200,10 +200,10 @@ public FSFile moveFile(
200200 ) throws DBWebException {
201201 validateEditPermissions (webSession );
202202 try {
203- DBNPathBase oldNode = FSUtils .getNodeByPath (webSession , oldNodePath );
203+ DBNPathBase oldNode = WebFSUtils .getNodeByPath (webSession , oldNodePath );
204204 DBNPathBase oldParentNode = (DBNPathBase ) oldNode .getParentNode ();
205205 String fileName = oldNode .getName ();
206- DBNPathBase parentNode = FSUtils .getNodeByPath (webSession , parentNodePath );
206+ DBNPathBase parentNode = WebFSUtils .getNodeByPath (webSession , parentNodePath );
207207 Path parentPath = parentNode .getPath ();
208208 if (!Files .isDirectory (parentPath )) {
209209 throw new DBException (MessageFormat .format ("Node ''{0}'' is not a directory" , parentPath ));
@@ -227,7 +227,7 @@ public FSFile renameFile(
227227 validateEditPermissions (webSession );
228228 validateFilename (newName );
229229 try {
230- DBNPathBase node = FSUtils .getNodeByPath (webSession , nodePath );
230+ DBNPathBase node = WebFSUtils .getNodeByPath (webSession , nodePath );
231231 node .rename (webSession .getProgressMonitor (), newName );
232232 return new FSFile (node );
233233 } catch (Exception e ) {
@@ -243,9 +243,9 @@ public FSFile copyFile(
243243 ) throws DBWebException {
244244 validateEditPermissions (webSession );
245245 try {
246- DBNPathBase oldNode = FSUtils .getNodeByPath (webSession , oldNodePath );
246+ DBNPathBase oldNode = WebFSUtils .getNodeByPath (webSession , oldNodePath );
247247 String fileName = oldNode .getName ();
248- DBNPathBase parentNode = FSUtils .getNodeByPath (webSession , parentNodePath );
248+ DBNPathBase parentNode = WebFSUtils .getNodeByPath (webSession , parentNodePath );
249249 Path parentPath = parentNode .getPath ();
250250 if (!Files .isDirectory (parentPath )) {
251251 throw new DBException (MessageFormat .format ("Node ''{0}'' is not a directory" , parentPath ));
@@ -267,7 +267,7 @@ public FSFile createFolder(
267267 ) throws DBWebException {
268268 validateEditPermissions (webSession );
269269 try {
270- DBNPathBase parentNode = FSUtils .getNodeByPath (webSession , parentPath );
270+ DBNPathBase parentNode = WebFSUtils .getNodeByPath (webSession , parentPath );
271271 if (!Files .isDirectory (parentNode .getPath ())) {
272272 throw new DBException (MessageFormat .format ("Node ''{0}'' is not a directory" , parentPath ));
273273 }
@@ -287,7 +287,7 @@ public boolean deleteFile(
287287 ) throws DBWebException {
288288 validateEditPermissions (webSession );
289289 try {
290- DBNPathBase node = FSUtils .getNodeByPath (webSession , nodePath );
290+ DBNPathBase node = WebFSUtils .getNodeByPath (webSession , nodePath );
291291 Path path = node .getPath ();
292292 Files .delete (path );
293293 DBNPathBase parentNode = (DBNPathBase ) node .getParentNode ();
0 commit comments