Assignment3_Server_xmlrpc/src/service/FileService.java
@Override
	public String uploadFile(String fileName, String fileExtension, byte[] fileContent) {
		try {
			// Create a new file & avoid duplicated file names.
//			File uploadedFileLoc = new File(FileService.uploadDir);
//			File uploadedFile = File.createTempFile(fileName + "-", "." + fileExtension, uploadedFileLoc);
			File uploadedFile = new File(FileService.uploadDir + fileName + "." + fileExtension);
			
			// write content of uploaded file to
			Files.write(uploadedFile.toPath(), fileContent);
		} catch (Exception e) {
			return e.getMessage();
		} 
		
		return "Upload successful!";
	}
/**
	 * Upload a file to a dirPath on the Server specified by Client.
	 * @param fileName The name of the file without extension.
	 * @param fileExtension The extension of the file without the dot character.
	 * @param fileContent Bytes of the file you wish to upload.
	 * @return a message informs that the operation was successful, else an exception message.
	 * @see <a href="https://docs.oracle.com/javase/7/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File)">
	 * 		createTempFile</a> for possible exceptions.
	 * @see <a href="https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#write(java.nio.file.Path,%20byte[],%20java.nio.file.OpenOption...)">
	 * 		write</a> for possible exceptions.
	 */
Upload a file to a dirPath on the Server specified by Client.
@param fileName The name of the file without extension.
@param fileExtension The extension of the file without the dot character.
@param fileContent Bytes of the file you wish to upload.
@return a message informs that the operation was successful, else an exception message.
@see 
createTempFile for possible exceptions.
@see 
write for possible exceptions.
Upload a file to a dirPath on the Server specified by Client . @param fileName The name of the file without extension . @param fileExtension The extension of the file without the dot character . @param fileContent Bytes of the file you wish to upload . @return a message informs that the operation was successful else an exception message . @see createTempFile for possible exceptions . @see write for possible exceptions .
@Override
	public String uploadFile(String fileName, String fileExtension, byte[] fileContent) {
		try {
			File uploadedFile = new File(FileService.uploadDir + fileName + "." + fileExtension);
			Files.write(uploadedFile.toPath(), fileContent);
		} catch (Exception e) {
			return e.getMessage();
		} 
		return "Upload successful!";
	}
@ Override public String uploadFile ( String fileName , String fileExtension , byte [ ] fileContent ) { try { File uploadedFile = new File ( FileService . uploadDir + fileName + "." + fileExtension ) ; Files . write ( uploadedFile . toPath ( ) , fileContent ) ; } catch ( Exception e ) { return e . getMessage ( ) ; } return "Upload successful!" ; }
Upload a file to a dirPath on the Server specified by Client.
Upload a file to a dirPath on the Server specified by Client .
// Create a new file & avoid duplicated file names. //			File uploadedFileLoc = new File(FileService.uploadDir); //			File uploadedFile = File.createTempFile(fileName + "-", "." + fileExtension, uploadedFileLoc); // write content of uploaded file to