questo è il codice dell'applet!! scusate la confusione ma è in fase di lavorazione! 
codice:
public void saveToFile(String name, AudioFileFormat.Type fileType)
/* */ {
/* 255 */ if (this.audioInputStream == null) {
/* 256 */ reportStatus("No loaded audio to save");
/* 257 */ return;
/* 258 */ }if (this.file != null) {
/* 259 */ createAudioInputStream(this.file, false);
/* */ }
/* */
/* */ try
/* */ {
/* 264 */ this.audioInputStream.reset();
/* */ } catch (Exception e) {
/* 266 */ reportStatus("Unable to reset stream " + e);
/* 267 */ return;
/* */ }
/* */
/* 270 */ File file = new File(System.getProperty("user.home")+System.getProperty("file.separator")+this.fileName+" - analisivocale.wav");
/* */ try
/* */ {//la riga sotto completa la scrittura del file
/* 273 */ if (AudioSystem.write(this.audioInputStream, fileType, file) == -1)
/* 274 */ throw new IOException("Problems writing to file");
/* */ } catch (Exception ex) {
/* 276 */ reportStatus(ex.toString());
/* 277 */ }this.samplingGraph.repaint();
/* */
/* 282 */ Vector v = new Vector();
/* 283 */ FileInputStream fis = null;
/* */ try {
/* 285 */ fis = new FileInputStream(file);
/* */ } catch (FileNotFoundException ex) {
/* 287 */ ex.printStackTrace();
/* */ }
/* 289 */ int i = 0;
/* */ try {
/* 291 */ while ((i = fis.read()) != -1)
/* 292 */ v.add(new Integer(i));
/* */ } catch (IOException ex) {
/* 294 */ ex.printStackTrace();
/* */ }
/* */
/* 297 */ Vector vett = new Vector();
/* 298 */ vett = coppia(v, this.fileName);
/* */ try
/* */ {
String sep=System.getProperty("file.separator");
String pathcompleto="http:"+sep+sep+sep+sep+ip+":"+port+sep+sep+"ReVA1.0"+sep+sep+"ObjectServlet";
/* 305 */ //System.out.println("ip "+this.ip + "- porta "+this.port + "- pathcompleto "+pathcompleto);
send(this.ip, this.port, pathcompleto, vett);
/* */ }
/* */ catch (IOException e) {
/* */ }
/* */ try {
/* 310 */ System.out.println("stringa inviata da: " + InetAddress.getLocalHost());
/* */ } catch (UnknownHostException ex) {
/* 312 */ ex.printStackTrace();
/* */ }
/* */ }
/* */
/* */ public Vector coppia(Vector v, String Username) {
/* 317 */ Vector stringa = new Vector();
/* 318 */ stringa.add(Username);
/* 319 */ Vector cp = new Vector();
/* 320 */ cp.add(stringa);
/* 321 */ cp.add(v);
/* 322 */ return cp;
/* */ }
/* */ public void send(String addr, int p, String path, Serializable obj) throws IOException
/* */ {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(buffer);
out.writeObject(obj);
byte[] serobj = buffer.toByteArray();
StringBuffer outb = new StringBuffer();
outb.append("POST ");
outb.append(path);
outb.append(" HTTP/1.0\r\nUser-Agent: JavaObjectTunnel\r\n");
outb.append("Content-Type: application/java-object\r\n");
outb.append("Content-Length: ");
outb.append(serobj.length);
outb.append("\r\n\r\n");
Socket s = new Socket(addr, p);
OutputStream sout = s.getOutputStream();
sout.write(outb.toString().getBytes());
sout.write(serobj);
sout.write("\r\n".getBytes());
s.close();
}
e questo è il file che viene puntato dall' applet!!
codice:
public class ObjectServlet extends HttpServlet
/* */ {
/* */ HttpSession session;
/* */
/* */ public ObjectServlet()
/* */ {
/* 23 */ this.session = null;
/* */ }
/* */
/* */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
/* */ {
/* 28 */ ObjectInputStream in = new ObjectInputStream(request.getInputStream());
/* 29 */ int param = 0;
/* 30 */ int UserCode = 0;
/* 31 */ String Username = "";
/* 32 */ String temp = "";
/* 33 */ String temp2 = "";
/* */ try
/* */ {
/* 38 */ Vector vett = (Vector)in.readObject();
/* 39 */ Vector vettWave = (Vector)vett.get(1);
/* 40 */ Vector vettString = (Vector)vett.get(0);
/* 41 */ Username = (String)vettString.get(0);
/* 42 */ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd_hh.mm");
/* 43 */ Date currentTime_1 = new Date();
/* 44 */ String dateString = formatter.format(currentTime_1);
/* */
/* 46 */ String pathFile = "C:/Programmi/tomcat50-jwsdp/webapps/ReVA/wav/" + Username + "_" + dateString + ".wav";
/* 47 */ writefile(vettWave, pathFile);
/* */
/* 50 */ GestioneDB db = new GestioneDB();
/* 51 */ Vector v = db.getUserParameter(Username);
/* 52 */ temp2 = (String)v.get(0);
/* 53 */ UserCode = Integer.parseInt(temp2);
/* 54 */ temp = (String)v.get(1);
/* 55 */ if (temp.equals("1"))
/* 56 */ param = 1;
/* 57 */ if (temp.equals("2"))
/* 58 */ param = 2;
/* 59 */ if (temp.equals("3"))
/* 60 */ param = 3;
/* 61 */ if (temp.equals("4")) {
/* 62 */ param = 4;
/* */ }
/* */
/* 65 */ Input input = new Input(pathFile, param);
/* 66 */ input.StartEngine();
/* 67 */ String value = input.getOutput().getResult();
/* */
/* 69 */ if ((value == "") || (value == null)) {
/* 70 */ value = "FILE NON VALUTABILE DAL MODULO AUTOMATICO";
/* */ }
/* */
/* 75 */ db.NewExam(UserCode, dateString, "wav/" + Username + "_" + dateString + ".wav", value, "In Attesa di Valutazione Medico");
/* */ }
/* */ catch (ClassNotFoundException e)
/* */ {
/* */ }
/* */ }
/* */
/* */ public void writefile(Vector text, String name)
/* */ {
/* */ try
/* */ {
/* 86 */ Object[] texti = text.toArray();
/* 87 */ FileOutputStream fos = new FileOutputStream(name);
/* 88 */ for (int i = 0; i < texti.length; ++i)
/* 89 */ fos.write(Integer.parseInt(texti[i].toString()));
/* */ }
/* */ catch (Exception e) {
/* 92 */ System.out.println("errore try catch writefile " + e);
/* */ }
/* */ }
/* */ }
non so perchè non mi ritrovo il file sul server! da nessuna parte!! sul client invece si!
grazie per qualsiasi consiglio utile!!