Package com.aelitis.azureus.core.util

Examples of com.aelitis.azureus.core.util.CaseSensitiveFileMap


  public void
  setFileLink(
    File  link_source,
    File  link_destination )
  {
    CaseSensitiveFileMap  links = getFileLinks();
   
    File  existing = (File)links.get(link_source);
   
    if ( link_destination == null ){
     
      if ( existing == null ){
       
        return;
      }
    }else if ( existing != null && existing.equals( link_destination )){
     
      return;
    }
   
    links.put( link_source, link_destination );
   
    List  list = new ArrayList();
   
    Iterator  it = links.keySetIterator();
   
    while( it.hasNext()){
     
      File  source = (File)it.next();
      File  target = (File)links.get(source);
     
      String  str = source + "\n" + (target==null?"":target.toString());
     
      list.add( str );
    }
View Full Code Here


  }
 
  public void
  clearFileLinks()
  {
    CaseSensitiveFileMap  links = getFileLinks();
   
    List  list = new ArrayList();
   
    Iterator  it = links.keySetIterator();
   
    boolean  changed = false;
   
    while( it.hasNext()){
     
      File  source = (File)it.next();
      File  target = (File)links.get(source);
     
      if ( target != null ){
       
        changed = true;
      }
View Full Code Here

  public CaseSensitiveFileMap
  getFileLinks()
  {
    List  values = getListAttributeSupport( AT_FILE_LINKS );

    CaseSensitiveFileMap  res = new CaseSensitiveFileMap();
   
    for (int i=0;i<values.size();i++){
     
      String  entry = (String)values.get(i);
   
      int  sep = entry.indexOf( "\n" );
     
      if ( sep != -1 ){
       
        File target = (sep == entry.length()-1)?null:new File( entry.substring( sep+1 ));
       
        res.put( new File( entry.substring(0,sep)), target );
      }
    }
   
    return( res );
  }
View Full Code Here

    }
   
    public CaseSensitiveFileMap
    getFileLinks()
    {
      return( new CaseSensitiveFileMap());
    }
View Full Code Here

    catch (IOException ioe) {new_save_path = new_save_path.getAbsoluteFile();}
   
    String old_path = old_save_path.getPath();
    String new_path = new_save_path.getPath();
   
    CaseSensitiveFileMap links = download_manager_state.getFileLinks();
    Iterator it = links.keySetIterator();
   
    while(it.hasNext()){
      File  from   = (File)it.next();
      File  to    = (File)links.get(from);
      String  from_s  = (from == null) ? null : from.getAbsolutePath();
      String  to_s    = (to == null) ? null : to.getAbsolutePath();
   
      try {
        updateFileLink(old_path, new_path, from_s, to_s);
View Full Code Here

  }
 
  public CaseSensitiveFileMap
  getFileLinks()
  {
    return( new CaseSensitiveFileMap());
  }
View Full Code Here

      Debug.printStackTrace(e);
     
      links_key  = "";
    }
   
    CaseSensitiveFileMap  links_entry = (CaseSensitiveFileMap)links.get( links_key );
   
    if ( links_entry == null ){
     
      links_entry  = new CaseSensitiveFileMap();
     
      links.put( links_key, links_entry );
    }
   
    return( links_entry );
View Full Code Here

    CaseSensitiveFileMap  new_links )
  {
    try{
      links_mon.enter();
     
      CaseSensitiveFileMap  links_entry = getLinksEntry( torrent );
     
      Iterator  it = new_links.keySetIterator();
     
      while( it.hasNext()){
       
        File  source   = (File)it.next();
        File  target  = (File)new_links.get(source);
       
        // System.out.println( "setLink:" + source + " -> " + target );
       
        if ( target != null && !source.equals(target)){
         
          links_entry.put( source, target );
        }else{
         
          links_entry.remove( source );
        }
      }
    }finally{
     
      links_mon.exit();
View Full Code Here

    File    file )
  {
    try{
      links_mon.enter();
     
      CaseSensitiveFileMap  links_entry = getLinksEntry( torrent );

      File  res = (File)links_entry.get( file );
     
      if ( res == null ){
       
        res = file;
      }
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.util.CaseSensitiveFileMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.