mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-16 06:15:02 -05:00
Set .xattr folder hidden on Windows
This commit is contained in:
parent
be7f86bf98
commit
4a090ff576
@ -8,6 +8,7 @@ import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.attribute.DosFileAttributeView;
|
||||
import java.util.List;
|
||||
|
||||
public class PlainFileXattrView implements XattrView {
|
||||
@ -39,7 +40,15 @@ public class PlainFileXattrView implements XattrView {
|
||||
|
||||
@Override
|
||||
public void write(String key, String value) throws IOException {
|
||||
if (!Files.isDirectory(folder)) {
|
||||
Files.createDirectories(folder);
|
||||
|
||||
// set Hidden on Windows
|
||||
if (Files.getFileStore(folder).supportsFileAttributeView(DosFileAttributeView.class)) {
|
||||
Files.getFileAttributeView(folder, DosFileAttributeView.class).setHidden(true);
|
||||
}
|
||||
}
|
||||
|
||||
Files.write(folder.resolve(key), value.getBytes(UTF_8));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user