if(b) // resource has an acl
{
// load it
FileInputStream fis = new FileInputStream(aclFile);
final Properties properties = new Properties();
properties.load(fis, new AsyncCallback<Boolean>()
{
public void onSuccess(Boolean b)
{
if(properties.get("@public") == null)
properties.put("@public", "");
if(properties.get("@users") == null)
properties.put("@users", "");
callback.onSuccess(new ACL(file,properties,aclFile));
}
public void onFailure(Throwable t)
{
callback.onFailure(t);
}
});
}else
{
final File metaDir = new File(aclDirPath);
// acl does not exist. check if meta dir exists
metaDir.exists(new AsyncCallback<Boolean>()
{
public void onSuccess(Boolean b)
{
if(b)// meta dir exists
{
// return and empty property
Properties properties = new Properties();
properties.put("@public", "");
properties.put("@users", "");
callback.onSuccess(new ACL(file,properties,aclFile));
}else
{
metaDir.mkdirs(new AsyncCallback<Boolean>()
{
public void onSuccess(Boolean b)
{
Properties properties = new Properties();
properties.put("@public", "");
properties.put("@users", "");
// return the default property
callback.onSuccess(new ACL(file,properties,aclFile));
}
public void onFailure(Throwable t)