Package com.aelitis.azureus.core.diskmanager.file

Examples of com.aelitis.azureus.core.diskmanager.file.FMFileManagerException


  {
    String  str = is_read?"read":"write";
     
    if ( piece_number >= num_pieces ){
     
      throw( new FMFileManagerException( "Attempt to " + str + " piece " + piece_number + ": last=" + num_pieces ));
    }
   
    int  this_piece_size = piece_number==0?first_piece_length:(piece_number==(num_pieces-1)?last_piece_length:piece_size);
   
    final int  piece_space = this_piece_size - piece_offset;
   
    if ( piece_space <= 0 ){
     
      throw( new FMFileManagerException( "Attempt to " + str + " piece " + piece_number + ", offset " + piece_offset + " - no space in piece" ));
    }
   
    int  rem_space = piece_space;
   
    int[]  limits = new int[buffers.length];
View Full Code Here


           
            bb.put( new byte[rem] );
          }
        }else{
       
          throw( new FMFileManagerException( "partial write operation" ));
        }
       
        return;
      }
     
View Full Code Here

     
      int  store_index = getPieceIndex( raf, piece_number, false );
     
      if ( store_index == -1 ){
       
        throw( new FMFileManagerException( "piece marked as complete but not yet allocated" ));
      }
     
      if ( piece_number == store_index ){
       
          // already in the right place
       
        if ( TRACE ){
          System.out.println( "    already in right place" );
        }
       
        return;
      }
     
        // find out what's currently stored in the place this piece should be
     
      int  swap_piece_number = piece_reverse_map[ piece_number ];
     
      if ( swap_piece_number < 1 ){
       
        throw( new FMFileManagerException( "Inconsistent: failed to find piece to swap" ));
      }
     
      if ( TRACE ){
        System.out.println( "    swapping " + piece_number + " and " + swap_piece_number + ": " + piece_number + " <-> " + store_index );
      }
View Full Code Here

   
    next_piece_index     = piece_count;
   
    writeConfig();
   
    FMFileManagerException e = new FMFileManagerException( error );
   
    e.setRecoverable( false );
   
    throw( e );
  }
View Full Code Here

      control_dir.mkdirs();
    }
   
    if ( !FileUtil.writeResilientFileWithResult( control_dir, config_file.getName(), map )){
     
      throw( new FMFileManagerException( "Failed to write control file " + config_file.getAbsolutePath()));
    }
  }
View Full Code Here

      control_dir.mkdirs();
    }
   
    if ( !FileUtil.writeResilientFileWithResult( control_dir, control_file, map )){
     
      throw( new FMFileManagerException( "Failed to write control file " + new File( control_dir, control_file ).getAbsolutePath()));
    }

    if ( TRACE ){
      System.out.println( "WriteConfig: length=" + current_length + ", next=" + next_piece_index );
    }
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.diskmanager.file.FMFileManagerException

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.