throw ioe;
}
}catch( Throwable e ){
throw( new FMFileManagerException( "getCanonicalPath fails", e ));
}
if ( new_linked_file.exists()){
throw( new FMFileManagerException( "moveFile fails - file '" + new_canonical_path + "' already exists"));
}
boolean was_open = isOpen();
close(); // full close, this will release any slots in the limited file case
createDirs( new_linked_file );
if ( !linked_file.exists() || FileUtil.renameFile( linked_file, new_linked_file )) {
linked_file = new_linked_file;
canonical_path = new_canonical_path;
reserveFile();
if ( was_open ){
ensureOpen( "moveFile target" ); // ensure open will regain slots in limited file case
}
}else{
try{
reserveFile();
}catch( FMFileManagerException e ){
Debug.printStackTrace( e );
}
if ( was_open ){
try{
ensureOpen( "moveFile recovery" );
}catch( FMFileManagerException e){
Debug.printStackTrace( e );
}
}
throw( new FMFileManagerException( "moveFile fails"));
}
}finally{
this_mon.exit();
}