ujaen.sinai.iliasEBookServer_v20
Class Host

java.lang.Object
  extended by ujaen.sinai.iliasEBookServer_v20.Host

public class Host
extends java.lang.Object

Clase Host de la API de ILIAS. Crea un host al que se conectara el repositorio
Ejemplo de uso: Host h = new Host("dv.ujaen.es");


Constructor Summary
Host(java.lang.String name)
           Constructor de la clase
 
Method Summary
 boolean checkCertificate()
           Comprueba si la maquina virtual de java posee el certificado digital del host
 java.lang.String getHostName()
           Devuelve la url del host
 void saveCertificate(java.lang.String path)
          Almacena el certificado digital en la maquina.
 void setHostName(java.lang.String newHostName)
           Asigna una nueva url al host
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Host

public Host(java.lang.String name)

Constructor de la clase

Parameters:
name - Es la url del sitio web del cual se quiere obtener el certificado (sin http://)
Method Detail

setHostName

public void setHostName(java.lang.String newHostName)

Asigna una nueva url al host

Parameters:
newHostName - url del nuevo sitio web

getHostName

public java.lang.String getHostName()

Devuelve la url del host

Returns:
url del sitio web con el que se esta trabajando

checkCertificate

public boolean checkCertificate()
                         throws java.io.FileNotFoundException,
                                java.security.KeyStoreException,
                                java.io.IOException,
                                java.security.NoSuchAlgorithmException,
                                java.security.cert.CertificateException,
                                java.security.KeyManagementException

Comprueba si la maquina virtual de java posee el certificado digital del host

Returns:
true si el certificado digital está instalado en la maquina. false en otro caso
Throws:
FileNotFoundException, - KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, KeyManagementException
java.io.FileNotFoundException
java.security.KeyStoreException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
java.security.KeyManagementException

saveCertificate

public void saveCertificate(java.lang.String path)
                     throws java.io.FileNotFoundException,
                            java.security.KeyStoreException,
                            java.io.IOException,
                            java.security.NoSuchAlgorithmException,
                            java.security.cert.CertificateException,
                            java.security.KeyManagementException,
                            java.lang.Exception

Almacena el certificado digital en la maquina. Es necesario almacenarlo en $JAVA_HOME(/usr/lib/jvm/java-6-sub)/jre/lib/security de la maquina que vaya a acceder al sitio web


Ejemplo de uso: host.saveCertificate("/home/myHome/certificados/");

Parameters:
path - Es la ruta donde se almacenara el certificadod digital
Throws:
FileNotFoundException, - KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, KeyManagementException, Exception
java.io.FileNotFoundException
java.security.KeyStoreException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
java.security.KeyManagementException
java.lang.Exception