Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/10/2005, 15:13
kiewic
 
Fecha de Ingreso: abril-2004
Ubicación: Ciudad de México
Mensajes: 52
Antigüedad: 20 años, 1 mes
Puntos: 1
Ruta Menú Inicio No Abre

Hola, estoy intentando hacer un programa que ponga un acceso directo en el menú archivo, así que copio el archivo a la ruta del ".../menú archivos/programas" pero no funciona, parece que el rpoblema esta justo en la parte del acento, porque si intento copiar el archivo a cualquier otra ruta sin acentos si funciona, alguien sabe como solucionar esto??? pongfo aquí mi codigo.


import java.nio.channels.FileChannel;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.FileOutputStream;
class Bichito{
public static void main(String args[]){

// Ruta de origen
// user.dir es el directorio actual
String origen = "C:\\Documents and Settings\\stan\\Mis documentos\\hola.txt";

// Ruta de destino
//String destino = System.getProperty("user.home")+"\\Menu Inicio\\Programas\\Inicio\\hola.txt";
String destino = System.getProperty("user.home")+"\\Escritorio\\hol *\\hola.txt";

try{
// Create channel on the source
FileChannel srcChannel = new FileInputStream( origen ).getChannel();

// Create channel on the destination
FileChannel dstChannel = new FileOutputStream( destino ).getChannel();

// Copy file contents form source to destination
dstChannel.transferFrom(srcChannel,0,srcChannel.si ze());

// Close channels
srcChannel.close();
dstChannel.close();
}

catch(IOException e){
System.out.println(e);
}

}
}