RootDir.java :  » Google-tech » goofs » goofs » fs » Java Open Source

Java Open Source » Google tech » goofs 
goofs » goofs » fs » RootDir.java
package goofs.fs;

import fuse.Errno;
import goofs.GoofsProperties;
import goofs.fs.blogger.BlogsDir;
import goofs.fs.calendar.CalendarsDir;
import goofs.fs.contacts.ContactsDir;
import goofs.fs.docs.DocsDir;
import goofs.fs.photos.PhotosDir;

public class RootDir extends Dir {

  public RootDir() throws Exception {

    super(null, "", 0777, "description", "ROOT directory");

    AddDirThread t;

    if (Boolean.TRUE.toString().equals(
        GoofsProperties.INSTANCE.getProperty("goofs.blogger.enabled"))) {

      t = new AddDirThread(this, BlogsDir.class);
      t.start();
    }

    if (Boolean.TRUE.toString().equals(
        GoofsProperties.INSTANCE.getProperty("goofs.photos.enabled"))) {
      t = new AddDirThread(this, PhotosDir.class);
      t.start();
    }

    if (Boolean.TRUE.toString().equals(
        GoofsProperties.INSTANCE.getProperty("goofs.contacts.enabled"))) {
      t = new AddDirThread(this, ContactsDir.class);
      t.start();
    }

    if (Boolean.TRUE.toString().equals(
        GoofsProperties.INSTANCE.getProperty("goofs.calendar.enabled"))) {
      t = new AddDirThread(this, CalendarsDir.class);
      t.start();
    }

    if (Boolean.TRUE.toString().equals(
        GoofsProperties.INSTANCE.getProperty("goofs.docs.enabled"))) {
      t = new AddDirThread(this, DocsDir.class);
      t.start();
    }

  }

  @Override
  public int delete() {
    return Errno.EROFS;
  }

  @Override
  public int rename(Dir newParent, String name) {
    return Errno.EROFS;
  }

  @Override
  public void remove() {
  }

  @Override
  public int createChild(String name, boolean isDir) {
    return Errno.EROFS;
  }

  @Override
  public int createTempChild(String name) {
    return Errno.EROFS;
  }

  @Override
  public int createChildFromExisting(String name, Node child) {
    return Errno.EROFS;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.