获取 FileSystemException “客户端不持有所需的权限";在 Play 框架中使用 Files.createSymbolicLink [英] Getting FileSystemException "A required privilege is not held by the client" using Files.createSymbolicLink in Play Framework

查看:38
本文介绍了获取 FileSystemException “客户端不持有所需的权限";在 Play 框架中使用 Files.createSymbolicLink的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用新的 Java 7 Files.createSymbolicLink() Play 中的方法!框架,我得到了以下异常:

I'm trying to use the new Java 7 Files.createSymbolicLink() method within Play! Framework, and I got the following exception:

RuntimeException occured : java.nio.file.FileSystemException: c:workfooar:
A required privilege is not held by the client.

这是我第一次接触 Java 的权限模型,所以我明白发生了什么,但还不知道如何解决它(我想给控制器更多的权限).

This is my first encounter with Java's permission model, so I understand what's going on, but don't yet know how to fix it (I'd like to give the Controllers more permissions).

如果有人能比我找到答案更快地回答这里,我(和未来的读者)将不胜感激.

If anyone can answer here faster than I'll find the answer, me (and future readers) will be grateful.

推荐答案

这不是java权限的问题,而是操作系统权限的问题.请参阅FileSystemException.

This isn't a problem with java permissions, but a problem with the operating system permissions. See FileSystemException.

FileSystemException 的子类有:AccessDeniedException、AtomicMoveNotSupportedException、DirectoryNotEmptyException、FileAlreadyExistsException、FileSystemLoopException、NoSuchFileException、NotDirectoryException、NotLinkException.

The subclasses of FileSystemException are: AccessDeniedException, AtomicMoveNotSupportedException, DirectoryNotEmptyException, FileAlreadyExistsException, FileSystemLoopException, NoSuchFileException, NotDirectoryException, NotLinkException.

来自 AccessDeniedException:

From AccessDeniedException:

当文件系统操作被拒绝时抛出的检查异常,通常是由于文件权限或其他访问检查.此异常与拒绝访问文件时访问控制器或安全管理器抛出的 AccessControlException 或 SecurityException 无关.

Checked exception thrown when a file system operation is denied, typically due to a file permission or other access check. This exception is not related to the AccessControlException or SecurityException thrown by access controllers or security managers when access to a file is denied.

这篇关于获取 FileSystemException “客户端不持有所需的权限";在 Play 框架中使用 Files.createSymbolicLink的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆