I lang tid har samarbejdsbranchen fokuseret på at forbedre enhedsfunktioner – bedre kameraer, klarere lyd og smartere software. Men den virkelige forvandling handler ikke om funktioner.
/** * * @author reinke * @version */ public class dirMove extends Object { /** The error code */ private int error=0;
File sourceDir,destDir;
public dirMove() { }
/** Moves directory from source to dest including everything beneath it * @param source The filepath to the source directory * @param dest The filepath to the destination * @return According to result of the moving of the directory */ public boolean move(String source, String dest) { //check if either source or dest is empty or null if ( (source.trim().length()==0) || (source==null) || (dest.trim().length()==0) || (dest==null) ) { error=1; return false; }
/** Returns the error text according to the value of 'error' * @return String containing the Error Text according to the value of {@link error} */ public String getError() { if(error==1) return "source eller dest er tom"; if(error==2) return "source er ikke en directory"; if(error==3) return "destination findes allerede!!!"; if(error==4) return "Could not create Directory"; if(error==5) return "File copy failed"; return ""; } }
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.