FolderItem.java :  » Browser » nookbibliotheca » dim133 » bibliotheca » items » Android Open Source

Android Open Source » Browser » nookbibliotheca 
nookbibliotheca » dim133 » bibliotheca » items » FolderItem.java
package dim133.bibliotheca.items;


import java.io.File;

import dim133.bibliotheca.enums.ItemType;
import dim133.bibliotheca.interfaces.IItem;
import dim133.bibliotheca.interfaces.IItemProvider;
import dim133.bibliotheca.providers.FileItemProvider;

public class FolderItem extends BaseItem implements IItem 
{

  String _path;
  
  public FolderItem(String path,IItemProvider parent)
  {
    super();
    
    
    _parent = parent;
    
    try
    {
      File  f = new File(path);
      if (!f.isDirectory()) 
        throw new Exception("Not folder");
      _title = f.getName();
        _type = ItemType.Folder;
      _children =  new FileItemProvider(_title,path, parent);

    }
    catch(Exception e)
    {
      _title = path;
      _children = null;
      _type = ItemType.Broken;
      _author = e.getMessage();
    }
    
    
    
  }

  
  public void Fill() 
  {
    if (_isfilled) return;
    
    _isfilled = true;

    
  }
  
  

}
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.