{"record":{"id":"005a91c6b19f6f16","repo":"oracle/graal","slug":"view-is-not-supported","errorCode":null,"errorMessage":"view <{}> is not supported","messagePattern":"view <(.+?)> is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso.io/src/sun/nio/fs/TruffleFileSystemProvider.java","lineNumber":317,"sourceCode":"        return (V) new TruffleBasicFileAttributeView(TrufflePath.toTrufflePath(path), TrufflePath.followLinks(options));\n    }\n\n    @Override\n    @SuppressWarnings(\"unchecked\")\n    public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException {\n        Objects.requireNonNull(type);\n        if (type != BasicFileAttributes.class) {\n            throw new UnsupportedOperationException();\n        }\n        return (A) getFileAttributeView(path, BasicFileAttributeView.class, options).readAttributes();\n    }\n\n    private TruffleBasicFileAttributeView getFileAttributeView(TrufflePath path, String type, LinkOption... options) {\n        Objects.requireNonNull(type);\n        if (\"basic\".equals(type)) {\n            return (TruffleBasicFileAttributeView) getFileAttributeView(path, BasicFileAttributeView.class, options);\n        }\n        throw new UnsupportedOperationException(\"view <\" + type + \"> is not supported\");\n    }\n\n    @Override\n    public Map<String, Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException {\n        String view;\n        String attrs;\n        int colonPos = attributes.indexOf(':');\n        if (colonPos == -1) {\n            view = \"basic\";\n            attrs = attributes;\n        } else {\n            view = attributes.substring(0, colonPos++);\n            attrs = attributes.substring(colonPos);\n        }\n        return getFileAttributeView(TrufflePath.toTrufflePath(path), view, options).readAttributes(attrs);\n    }\n\n    @Override","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso.io/src/sun/nio/fs/TruffleFileSystemProvider.java#L299-L335","documentation":"Thrown by the private TruffleFileSystemProvider.getFileAttributeView(TrufflePath, String, ...) when the requested file-attribute-view name is anything other than 'basic'. The Truffle file system implements only the basic view; posix, unix, dos, owner, acl, and user views have no native backing. It is reached from readAttributes(Path, String, ...) where the view is the prefix before ':' in the attribute string.","triggerScenarios":"Files.readAttributes(path, \"posix:*\"), readAttributes(path, \"unix:size,lastModifiedTime\", ...), or Files.getAttribute(path, \"owner:owner\") on a TrufflePath. Also Files.getPosixFileAttributes/Files.getFileAttributeView(path, PosixFileAttributeView.class) paths that funnel through the string form.","commonSituations":"Porting POSIX file code (permissions, uid/gid queries) to run inside an Espresso guest on Windows or on a host where only basic attributes are bridged; libraries like Apache Commons IO or sshd that query posix views unconditionally.","solutions":["Use the basic view: Files.readAttributes(path, \"basic:*\") or BasicFileAttributes.class","Guard with path.getFileSystem().supportedFileAttributeViews().contains(\"posix\") before requesting posix attributes","Wrap posix queries in try/catch UnsupportedOperationException and fall back to basic attributes"],"exampleFix":"// before\nPosixFileAttributes attrs = Files.readAttributes(path, PosixFileAttributes.class);\n\n// after\nBasicFileAttributes attrs;\nif (path.getFileSystem().supportedFileAttributeViews().contains(\"posix\")) {\n    attrs = Files.readAttributes(path, PosixFileAttributes.class);\n} else {\n    attrs = Files.readAttributes(path, BasicFileAttributes.class);\n}","handlingStrategy":"validation","validationCode":"Set<String> views = path.getFileSystem().supportedFileAttributeViews();\nString view = attributes.contains(\":\") ? attributes.substring(0, attributes.indexOf(':')) : \"basic\";\nif (!views.contains(view)) {\n    attributes = \"basic:lastModifiedTime,lastAccessTime,creationTime,size,isDirectory,isRegularFile\";\n}","typeGuard":null,"tryCatchPattern":"catch (UnsupportedOperationException e) { fall back to Files.readAttributes(path, BasicFileAttributes.class); }","preventionTips":["Query supportedFileAttributeViews() before requesting non-basic views","Isolate POSIX attribute code behind an interface with a basic-view fallback implementation"],"tags":["espresso","nio","file-attributes","posix","truffle"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}