下面显示了如何删除先前定义的属性:
import java.io.IOException; /*来自 N o w J a v a . c o m - 时 代 Java*/ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.UserDefinedFileAttributeView; public class Main { public static void main(String[] args) { Path path = Paths.get("C:/folder1/folder2/folder4", "test.txt"); UserDefinedFileAttributeView udfav = Files.getFileAttributeView(path, UserDefinedFileAttributeView.class); try { udfav.delete(