Example #1
0
  public boolean guardarArchivo(String nombre, byte[] contenido) {
    String rutaVideo = Configuracion.getString("rutaVideos");
    int longitudRelativa = Integer.valueOf(Configuracion.getString("logitudRelativa"));
    File f = new File(rutaVideo + nombre);
    try {
      System.out.println("PATH: " + f.getAbsolutePath());
      objVideo.setPath(
          Functions.substring(f.getAbsolutePath(), longitudRelativa, f.getAbsolutePath().length()));
      objVideo.setTitulo(nombre);
      System.out.println("cargar objeto fos ");
      FileOutputStream fos = new FileOutputStream(f);
      System.out.println("escribir fos ");
      fos.write(contenido);

      return true;
    } catch (Exception e) {
      Util.mostrarMensaje(e.getMessage());
      return false;
    }
  }