Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -632,12 +632,12 @@ public boolean delete( String fileSystem, String path, boolean force )
PathMap pathMap = getPathMap( fileSystem, path );
if ( pathMap == null )
{
logger.debug( "File not exists, {}", pathMap );
logger.debug( "File or directory not exists, {}", path );
return true;
}

String fileId = pathMap.getFileId();
if ( fileId == null )
if ( fileId == null ) // dir
{
// force or empty dir
if ( force || isEmptyDirectory( fileSystem, path ) )
Expand Down Expand Up @@ -689,8 +689,8 @@ private void postDeletionActions(String fileSystem, String path, PathMap pathMap

private boolean isEmptyDirectory( String fileSystem, String path )
{
path = PathMapUtils.normalizeParentPath( path );
BoundStatement bound = preparedListCheckEmpty.bind( fileSystem, path );
String normalized = PathMapUtils.normalizeParentPath( path );
BoundStatement bound = preparedListCheckEmpty.bind( fileSystem, normalized );
ResultSet result = executeSession( bound );
Row row = result.one();
boolean empty = false;
Expand All @@ -699,7 +699,7 @@ private boolean isEmptyDirectory( String fileSystem, String path )
long count = row.get( 0, Long.class );
empty = count <= 0;
}
logger.trace( "Dir '{}' is {} in fileSystem '{}'", path, ( empty ? "empty" : "not empty" ), fileSystem );
logger.trace( "Dir '{}' is {} in fileSystem '{}'", normalized, ( empty ? "empty" : "not empty" ), fileSystem );
return empty;
}

Expand Down