Unverified Commit 7d14d29c authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan Committed by GitHub
Browse files

Merge pull request #87 from iterate-ch/bugfix/issue-86

Expose case sensitivity settings
parents 59550a9c ae9e3d48
......@@ -250,9 +250,9 @@ public class OperationGETATTR extends AbstractNFSv4Operation {
case nfs4_prot.FATTR4_CANSETTIME:
return Optional.of(new fattr4_cansettime(true));
case nfs4_prot.FATTR4_CASE_INSENSITIVE:
return Optional.of(new fattr4_case_insensitive(true));
return Optional.of(new fattr4_case_insensitive(fs.getCaseInsensitive()));
case nfs4_prot.FATTR4_CASE_PRESERVING:
return Optional.of(new fattr4_case_preserving(true));
return Optional.of(new fattr4_case_preserving(fs.getCasePreserving()));
case nfs4_prot.FATTR4_CHOWN_RESTRICTED:
return Optional.empty();
case nfs4_prot.FATTR4_FILEID:
......
......@@ -140,6 +140,16 @@ public abstract class ForwardingFileSystem implements VirtualFileSystem {
delegate().setAcl(inode, acl);
}
@Override
public boolean getCaseInsensitive() {
return delegate().getCaseInsensitive();
}
@Override
public boolean getCasePreserving() {
return delegate().getCasePreserving();
}
@Override
public boolean hasIOLayout(Inode inode) throws IOException {
return delegate().hasIOLayout(inode);
......
......@@ -183,6 +183,16 @@ public class VfsCache extends ForwardingFileSystem {
invalidateStatCache(inode);
}
@Override
public boolean getCaseInsensitive() {
return _inner.getCaseInsensitive();
}
@Override
public boolean getCasePreserving() {
return _inner.getCasePreserving();
}
/*
Utility methods for cache manipulation.
*/
......
......@@ -297,6 +297,18 @@ public interface VirtualFileSystem {
*/
NfsIdMapping getIdMapper();
/**
* Determins if this file system is case insensitive.
* @return
*/
boolean getCaseInsensitive();
/**
* Determines if this case insensitive file system is case preserving.
* @return
*/
boolean getCasePreserving();
/**
* Object which represents write operation result.
*/
......
......@@ -583,6 +583,16 @@ public class DummyVFS implements VirtualFileSystem {
return _idMapper;
}
@Override
public boolean getCaseInsensitive() {
return true;
}
@Override
public boolean getCasePreserving() {
return true;
}
@Override
public byte[] getXattr(Inode inode, String attr) throws IOException {
long inodeNumber = toInodeNumber(inode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment