How to check if there is a FileObject file?

I am using Apache Commons VFS (Virtual File System) to access some files through SFTP. Does anyone know how to check if an instance of org.apache.commons.vfs.FileContent is a folder?

+3
source share
1 answer

If you mean checking FileObject, you can use [ FileObject.getType()] ( http://commons.apache.org/vfs/apidocs/org/apache/commons/vfs/FileObject.html#getType () . Given non-empty FileContent, you would always consider that this comes from the file .As the spec here says:

: , , , . , .

+8

Source: https://habr.com/ru/post/1712473/


All Articles