es.mcu.yingo.utils.fichero
Interface UtilFichero

All Known Implementing Classes:
UtilFicheroImp

public interface UtilFichero

Interfaz que define un gestor de ficheros y define las operaciones que deben poseer los objetos que deseen operar con ficheros.

Define operacionesz de creación, borrado, obtención del contenido del fichero, detalle de este, etc.

Author:
carlos.garcia.h

Method Summary
 void borrarFichero(java.lang.String pathRelativoFichero)
          Borra un fichero o directorio con el path Relativo
 void borrarFichero(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Borra el fichero indicado
 void borrarFicheroYDirectorioSiVacio(java.lang.String pathRelativoFichero)
          Borra el directorio y el fichero si al borra el fichero este se encuentra vacío
 java.lang.String crearZip(java.lang.String[] nombreFicheros, java.lang.String[] destinoFicheros)
          Crea un fichero en formato zip y devuelve la ruta de éste
 java.lang.String escribirFichero(java.io.InputStream miInputStream, java.lang.String pathRelativoFichero)
          Escribe un fichero a partir del InputStream y devuelve el path de dicho fichero
 java.lang.String escribirFichero(java.io.InputStream miInputStream, java.lang.String pathRelativo, java.lang.String nombreFichero)
          Escribe un fichero y devuelve el path de dicho fichero
 java.lang.String escribirFicheroDeString(java.lang.String cadenaFichero, java.lang.String pathRelativoFichero)
          Escribe un fichero con el contenido del String en la dirección relativa del fichero y devuelve el path de dicho fichero
 java.lang.String escribirFicheroDeString(java.lang.String cadenaFichero, java.lang.String pathRelativo, java.lang.String nombreFichero)
          Escribe un fichero con el contenido de una cadena, el el directorio y con el nombre del fichero indicado y devuelve el path de dicho fichero
 void escribirFicheroToOutputStream(java.lang.String pathRelativoFichero, java.io.OutputStream miOutputStream)
          Escribe el fichero definido por el path relativo en el OutputStream
 void escribirFicheroToOutputStream(java.lang.String pathRelativo, java.lang.String nombreFichero, java.io.OutputStream miOutputStream)
          Escribe el fichero definido por el path relativo y el nombre de fichero en el OutputStream
 boolean esDirectorioVacio(java.lang.String pathRelativoFichero)
          Devuelve true si es un directorio y está vacio, en el resto de casos (fichero, directorio no vacío, etc..)
 boolean esDirectorioVacio(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Devuelve true si es un directorio y está vacio, en el resto de casos (fichero, directorio no vacío, etc..)
 boolean esFichero(java.lang.String pathRelativoFichero)
          Devuelve si existe el fichero
 boolean esFichero(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Devuelve si existe el fichero
 java.lang.String getPathBase()
          Devuelve la ruta base del manejador de ficheros
 java.lang.String getPathIntermedio()
          Devuelve el path intermedio
 java.lang.String getPathRelativoFichero(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Obtiene el path relativo del fichero
 java.lang.String getPathTotal(java.lang.String pathRelativoFichero)
          Devuelve el la ruta absoluta con del path relativo del fichero
 java.lang.String getPathTotal(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Devuelve la ruta completa
 java.io.InputStream obtenerInputStreamFichero(java.lang.String pathRelativoFichero)
          Devuelve el InputStream de un fichero
 java.io.InputStream obtenerInputStreamFichero(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Devuelve el InputStream de un fichero
 java.lang.String obtenerMD5Fichero(java.lang.String pathRelativoFichero)
          Obtiene el checkSum MD5 del fichero del fichero
 java.lang.String obtenerMD5Fichero(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Obtiene el checkSum MD5 del fichero definido por el path relativo y el nombre del fichero
 java.lang.String obtenerMimeFichero(java.lang.String pathRelativoFichero)
          Obtiene el tipo Mime del fichero
 java.lang.String obtenerMimeFichero(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Obtiene el tipo Mime del fichero con el path relativo y el nombre de fichero
 java.lang.String obtenerSHA1Fichero(java.lang.String pathRelativoFichero)
          Obtiene el checkSum SHA1 del fichero del fichero
 java.lang.String obtenerSHA1Fichero(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Obtiene el checkSum SHA1 del fichero definido por el path relativo y el nombre del fichero
 java.lang.String obtenerSHA1FicheroBase64(java.lang.String pathRelativoFichero)
          Obtiene el checkSum SHA1 del fichero codificado en base64
 java.lang.String obtenerSHA1FicheroBase64(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Obtiene el checkSum SHA1 del fichero definido por el path relativo y el nombre del fichero, codificado en base64
 java.lang.String obtenerStringDeFichero(java.lang.String pathRelativoFichero)
          Devuelve un String con el contenido del fichero
 java.lang.String obtenerStringDeFichero(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Devuelve un String con el contenido del fichero, en el directorio relativo y con el nombre inidicado
 java.lang.Long obtenerTamanoFichero(java.lang.String pathRelativoFichero)
          Obtiene el tamaño del fichero
 java.lang.Long obtenerTamanoFichero(java.lang.String pathRelativo, java.lang.String nombreFichero)
          Obtiene el tamaño del fichero
 void setPathBase(java.lang.String pathBase)
          Asigna la ruta base del manejador de ficheros
 void setPathIntermedio(java.lang.String pathIntermedio)
          Asigna un pad intermedio al gestor de ficheros
 

Method Detail

getPathBase

java.lang.String getPathBase()
Devuelve la ruta base del manejador de ficheros

Returns:

setPathBase

void setPathBase(java.lang.String pathBase)
Asigna la ruta base del manejador de ficheros

Parameters:
pathBase -

escribirFichero

java.lang.String escribirFichero(java.io.InputStream miInputStream,
                                 java.lang.String pathRelativo,
                                 java.lang.String nombreFichero)
                                 throws java.io.IOException,
                                        FicheroYingoException
Escribe un fichero y devuelve el path de dicho fichero

Parameters:
miInputStream -
pathRelativo -
nombreFichero -
Returns:
Throws:
java.io.IOException
FicheroYingoException

escribirFichero

java.lang.String escribirFichero(java.io.InputStream miInputStream,
                                 java.lang.String pathRelativoFichero)
                                 throws java.io.IOException,
                                        FicheroYingoException
Escribe un fichero a partir del InputStream y devuelve el path de dicho fichero

Parameters:
miInputStream -
pathRelativoFichero -
Returns:
Throws:
java.io.IOException
FicheroYingoException

escribirFicheroDeString

java.lang.String escribirFicheroDeString(java.lang.String cadenaFichero,
                                         java.lang.String pathRelativoFichero)
                                         throws java.io.IOException,
                                                FicheroYingoException
Escribe un fichero con el contenido del String en la dirección relativa del fichero y devuelve el path de dicho fichero

Parameters:
cadenaFichero -
pathRelativoFichero -
Returns:
Throws:
java.io.IOException
FicheroYingoException

escribirFicheroDeString

java.lang.String escribirFicheroDeString(java.lang.String cadenaFichero,
                                         java.lang.String pathRelativo,
                                         java.lang.String nombreFichero)
                                         throws java.io.IOException,
                                                FicheroYingoException
Escribe un fichero con el contenido de una cadena, el el directorio y con el nombre del fichero indicado y devuelve el path de dicho fichero

Parameters:
cadenaFichero -
pathRelativo -
nombreFichero -
Returns:
Throws:
java.io.IOException
FicheroYingoException

borrarFichero

void borrarFichero(java.lang.String pathRelativo,
                   java.lang.String nombreFichero)
                   throws FicheroYingoException
Borra el fichero indicado

Parameters:
pathRelativo -
nombreFichero -
Throws:
FicheroYingoException

getPathTotal

java.lang.String getPathTotal(java.lang.String pathRelativo,
                              java.lang.String nombreFichero)
                              throws FicheroYingoException
Devuelve la ruta completa

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
FicheroYingoException

crearZip

java.lang.String crearZip(java.lang.String[] nombreFicheros,
                          java.lang.String[] destinoFicheros)
                          throws java.lang.Exception
Crea un fichero en formato zip y devuelve la ruta de éste

Parameters:
nombreFicheros -
destinoFicheros -
Returns:
Throws:
java.lang.Exception

obtenerInputStreamFichero

java.io.InputStream obtenerInputStreamFichero(java.lang.String pathRelativo,
                                              java.lang.String nombreFichero)
                                              throws java.io.FileNotFoundException,
                                                     FicheroYingoException
Devuelve el InputStream de un fichero

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
java.io.FileNotFoundException
FicheroYingoException

obtenerInputStreamFichero

java.io.InputStream obtenerInputStreamFichero(java.lang.String pathRelativoFichero)
                                              throws java.io.FileNotFoundException,
                                                     FicheroYingoException
Devuelve el InputStream de un fichero

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
java.io.FileNotFoundException
FicheroYingoException

obtenerStringDeFichero

java.lang.String obtenerStringDeFichero(java.lang.String pathRelativo,
                                        java.lang.String nombreFichero)
                                        throws java.io.IOException,
                                               FicheroYingoException
Devuelve un String con el contenido del fichero, en el directorio relativo y con el nombre inidicado

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
java.io.IOException
FicheroYingoException

obtenerStringDeFichero

java.lang.String obtenerStringDeFichero(java.lang.String pathRelativoFichero)
                                        throws java.io.IOException,
                                               FicheroYingoException
Devuelve un String con el contenido del fichero

Parameters:
pathRelativoFichero -
Returns:
Throws:
java.io.IOException
FicheroYingoException

obtenerMimeFichero

java.lang.String obtenerMimeFichero(java.lang.String pathRelativo,
                                    java.lang.String nombreFichero)
                                    throws FicheroYingoException
Obtiene el tipo Mime del fichero con el path relativo y el nombre de fichero

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
FicheroYingoException

obtenerMimeFichero

java.lang.String obtenerMimeFichero(java.lang.String pathRelativoFichero)
                                    throws FicheroYingoException
Obtiene el tipo Mime del fichero

Parameters:
pathRelativoFichero -
Returns:
Throws:
FicheroYingoException

escribirFicheroToOutputStream

void escribirFicheroToOutputStream(java.lang.String pathRelativo,
                                   java.lang.String nombreFichero,
                                   java.io.OutputStream miOutputStream)
                                   throws java.io.IOException,
                                          FicheroYingoException
Escribe el fichero definido por el path relativo y el nombre de fichero en el OutputStream

Parameters:
pathRelativo -
nombreFichero -
miOutputStream -
Throws:
java.io.IOException
FicheroYingoException

escribirFicheroToOutputStream

void escribirFicheroToOutputStream(java.lang.String pathRelativoFichero,
                                   java.io.OutputStream miOutputStream)
                                   throws java.io.IOException,
                                          FicheroYingoException
Escribe el fichero definido por el path relativo en el OutputStream

Parameters:
pathRelativoFichero -
miOutputStream -
Throws:
java.io.IOException
FicheroYingoException

obtenerSHA1Fichero

java.lang.String obtenerSHA1Fichero(java.lang.String pathRelativoFichero)
                                    throws java.security.NoSuchAlgorithmException,
                                           java.io.IOException,
                                           FicheroYingoException
Obtiene el checkSum SHA1 del fichero del fichero

Parameters:
pathRelativoFichero -
Returns:
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FicheroYingoException
FicheroYingoException

obtenerSHA1FicheroBase64

java.lang.String obtenerSHA1FicheroBase64(java.lang.String pathRelativoFichero)
                                          throws java.security.NoSuchAlgorithmException,
                                                 java.io.IOException,
                                                 FicheroYingoException
Obtiene el checkSum SHA1 del fichero codificado en base64

Parameters:
pathRelativoFichero -
Returns:
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FicheroYingoException
FicheroYingoException

obtenerSHA1Fichero

java.lang.String obtenerSHA1Fichero(java.lang.String pathRelativo,
                                    java.lang.String nombreFichero)
                                    throws java.security.NoSuchAlgorithmException,
                                           java.io.IOException,
                                           FicheroYingoException
Obtiene el checkSum SHA1 del fichero definido por el path relativo y el nombre del fichero

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FicheroYingoException

obtenerSHA1FicheroBase64

java.lang.String obtenerSHA1FicheroBase64(java.lang.String pathRelativo,
                                          java.lang.String nombreFichero)
                                          throws java.security.NoSuchAlgorithmException,
                                                 java.io.IOException,
                                                 FicheroYingoException
Obtiene el checkSum SHA1 del fichero definido por el path relativo y el nombre del fichero, codificado en base64

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FicheroYingoException

obtenerMD5Fichero

java.lang.String obtenerMD5Fichero(java.lang.String pathRelativoFichero)
                                   throws java.security.NoSuchAlgorithmException,
                                          java.io.IOException,
                                          FicheroYingoException
Obtiene el checkSum MD5 del fichero del fichero

Parameters:
pathRelativoFichero -
Returns:
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FicheroYingoException
FicheroYingoException

obtenerMD5Fichero

java.lang.String obtenerMD5Fichero(java.lang.String pathRelativo,
                                   java.lang.String nombreFichero)
                                   throws java.security.NoSuchAlgorithmException,
                                          java.io.IOException,
                                          FicheroYingoException
Obtiene el checkSum MD5 del fichero definido por el path relativo y el nombre del fichero

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FicheroYingoException

getPathTotal

java.lang.String getPathTotal(java.lang.String pathRelativoFichero)
                              throws FicheroYingoException
Devuelve el la ruta absoluta con del path relativo del fichero

Parameters:
pathRelativoFichero -
Returns:
Throws:
FicheroYingoException

esFichero

boolean esFichero(java.lang.String pathRelativo,
                  java.lang.String nombreFichero)
                  throws FicheroYingoException
Devuelve si existe el fichero

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
FicheroYingoException

esFichero

boolean esFichero(java.lang.String pathRelativoFichero)
                  throws FicheroYingoException
Devuelve si existe el fichero

Parameters:
pathRelativoFichero -
Returns:
Throws:
FicheroYingoException

getPathIntermedio

java.lang.String getPathIntermedio()
Devuelve el path intermedio

Returns:
the pathIntermedio

setPathIntermedio

void setPathIntermedio(java.lang.String pathIntermedio)
Asigna un pad intermedio al gestor de ficheros

Parameters:
pathIntermedio - the pathIntermedio to set

getPathRelativoFichero

java.lang.String getPathRelativoFichero(java.lang.String pathRelativo,
                                        java.lang.String nombreFichero)
                                        throws FicheroYingoException
Obtiene el path relativo del fichero

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
FicheroYingoException

borrarFichero

void borrarFichero(java.lang.String pathRelativoFichero)
                   throws FicheroYingoException
Borra un fichero o directorio con el path Relativo

Parameters:
pathRelativoFichero -
Throws:
FicheroYingoException

esDirectorioVacio

boolean esDirectorioVacio(java.lang.String pathRelativoFichero)
                          throws FicheroYingoException
Devuelve true si es un directorio y está vacio, en el resto de casos (fichero, directorio no vacío, etc..) devuelve false

Parameters:
pathRelativoFichero -
Returns:
Throws:
FicheroYingoException

esDirectorioVacio

boolean esDirectorioVacio(java.lang.String pathRelativo,
                          java.lang.String nombreFichero)
                          throws FicheroYingoException
Devuelve true si es un directorio y está vacio, en el resto de casos (fichero, directorio no vacío, etc..) devuelve false

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
FicheroYingoException

obtenerTamanoFichero

java.lang.Long obtenerTamanoFichero(java.lang.String pathRelativoFichero)
                                    throws java.security.NoSuchAlgorithmException,
                                           java.io.IOException,
                                           FicheroYingoException
Obtiene el tamaño del fichero

Parameters:
pathRelativoFichero -
Returns:
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FicheroYingoException

obtenerTamanoFichero

java.lang.Long obtenerTamanoFichero(java.lang.String pathRelativo,
                                    java.lang.String nombreFichero)
                                    throws java.security.NoSuchAlgorithmException,
                                           java.io.IOException,
                                           FicheroYingoException
Obtiene el tamaño del fichero

Parameters:
pathRelativo -
nombreFichero -
Returns:
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FicheroYingoException

borrarFicheroYDirectorioSiVacio

void borrarFicheroYDirectorioSiVacio(java.lang.String pathRelativoFichero)
                                     throws FicheroYingoException
Borra el directorio y el fichero si al borra el fichero este se encuentra vacío

Parameters:
pathRelativoFichero -
Throws:
FicheroYingoException