Commit 517cd9bf authored by acq1305's avatar acq1305
Browse files

creando un servicio

parent 4f351a91
......@@ -4,12 +4,9 @@ import bo.gob.softwarelibre.firmadorestatal.servidor.ServidorRest;
import bo.gob.softwarelibre.firmadorestatal.token.GestorSlot;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
......@@ -19,7 +16,6 @@ import java.io.InputStream;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.stage.Screen;
import javax.swing.ImageIcon;
import javax.swing.JButton;
......
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package bo.gob.softwarelibre.firmadorestatal.vista;
import bo.gob.softwarelibre.firmadorestatal.servidor.ServidorRest;
import bo.gob.softwarelibre.firmadorestatal.token.GestorSlot;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import sun.security.pkcs11.wrapper.PKCS11Exception;
/**
*
* @author acq1305
*/
public class Run {
/**
* Main para iniciar el servidor REST como demonio
*
* @param args
* @throws IOException
* @throws PKCS11Exception
*/
public static void main(String[] args) throws IOException, PKCS11Exception {
try {
GestorSlot gestorSlot;
gestorSlot = GestorSlot.getInstance();
gestorSlot.adicionarProveedor(proveedores(new File("token.cfg").getAbsolutePath ()));
ServidorRest rest = new ServidorRest();
rest = new ServidorRest();
rest.iniciar();
} catch (Exception e) {
System.out.println(e.getMessage());
System.out.println("error al iniciar el servidor REST con el Token (Instale el driver o revise la url del archivo token.cfg)");
}
}
/**
* cargo la lista de librerias para que el token trabaje con el sistema.
*
* @param conf
* @return retorna la lista de librerias para que el token trabaje con el
* sistema.
* @throws IOException
*/
private static String[] proveedores(String conf) throws IOException {
InputStream input = new FileInputStream(conf);
Properties prop = new Properties();
prop.load(input);
String[] librerias = prop.getProperty("proveedores").split(";");
return librerias;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment