Question : Is this optimal

So I download a file and then move out on to the network.  I then need to rename the file to a particular file name so another process can pick it up and finish with it.  That works.  However I kinda let the process get away from me so this was bolted on later and now I am going back through and seeing if part of the process is optimal.  I do a rename to move the code from the local to the network location and then I do a rename on the network to change the name.

thoughts, laughs, comments?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
public void doMove(File fileToMove,File destinationFile)
	{
                boolean success = fileToMove.renameTo(destinationFile);

                if(success)
		{
                  CommonLog.updateCommonLog("Moving File", "File Moved - success", true, false) ;
                }else
		{
		  CommonLog.updateCommonLog("Moving File", "File Moved - failed", true, false) ;
		}

                // File (or directory) with old name
                File file = destinationFile;
               
                // File (or directory) with new name
                File file2 = new File(propData.getProperty("Mapped_Network_Folder")+"Silverpop_Incremental.zip");
                // Rename file (or directory)
                boolean successful = file.renameTo(file2);

                if(successful)
		{
                  CommonLog.updateCommonLog("Changing File Name", "File Name Change - success", true, false) ;
		}else
		{
		  CommonLog.updateCommonLog("Changing File Name", "File Name Change - failed", true, false) ;
		}


	}

Answer : Is this optimal

that seems fine. is it the same application that will be accessing it at the new location, or a different app?
Random Solutions  
 
programming4us programming4us