ConnettoreFileApiHelper.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */
  20. package org.openspcoop2.core.config.rs.server.api.impl.erogazioni;

  21. import java.util.List;
  22. import java.util.Map;

  23. import org.openspcoop2.core.config.constants.CostantiConfigurazione;
  24. import org.openspcoop2.core.config.constants.StatoFunzionalita;
  25. import org.openspcoop2.core.config.rs.server.model.ConnettoreEnum;
  26. import org.openspcoop2.core.config.rs.server.model.ConnettoreFile;
  27. import org.openspcoop2.core.config.rs.server.model.ConnettoreFileRichiesta;
  28. import org.openspcoop2.core.config.rs.server.model.ConnettoreFileRisposta;
  29. import org.openspcoop2.core.config.rs.server.model.OneOfApplicativoServerConnettore;
  30. import org.openspcoop2.core.config.rs.server.model.OneOfConnettoreErogazioneConnettore;
  31. import org.openspcoop2.core.config.rs.server.model.OneOfConnettoreFruizioneConnettore;
  32. import org.openspcoop2.core.constants.CostantiDB;
  33. import org.openspcoop2.core.constants.TipiConnettore;
  34. import org.openspcoop2.core.registry.Connettore;
  35. import org.openspcoop2.web.ctrlstat.costanti.ConnettoreServletType;
  36. import org.openspcoop2.web.ctrlstat.plugins.ExtendedConnettore;
  37. import org.openspcoop2.web.ctrlstat.plugins.servlet.ServletExtendedConnettoreUtils;
  38. import org.openspcoop2.web.ctrlstat.servlet.connettori.ConnettoriCostanti;
  39. import org.openspcoop2.web.lib.mvc.ServletUtils;

  40. /**
  41.  * ConnettoreFileApiHelper
  42.  *
  43.  * @author $Author$
  44.  * @version $Rev$, $Date$
  45.  *
  46.  */
  47. public class ConnettoreFileApiHelper extends AbstractConnettoreApiHelper<ConnettoreFile> {

  48.     @Override
  49.     protected ConnettoreFile getConnettore(OneOfConnettoreErogazioneConnettore conn) throws Exception {
  50.         return (ConnettoreFile) conn;
  51.     }

  52.     @Override
  53.     protected ConnettoreFile getConnettore(OneOfConnettoreFruizioneConnettore conn) throws Exception {
  54.         return (ConnettoreFile) conn;
  55.     }

  56.     @Override
  57.     protected ConnettoreFile getConnettore(OneOfApplicativoServerConnettore conn) throws Exception {
  58.         return (ConnettoreFile) conn;
  59.     }

  60.     @Override
  61.     public boolean connettoreCheckData(ConnettoreFile conn, ErogazioniEnv env, boolean erogazione) throws Exception {


  62.         final String endpointtype = TipiConnettore.FILE.getNome();
  63.        
  64.         org.openspcoop2.core.registry.Connettore conTmp = null;
  65.         List<ExtendedConnettore> listExtendedConnettore =
  66.                 ServletExtendedConnettoreUtils.getExtendedConnettore(conTmp, ConnettoreServletType.ACCORDO_SERVIZIO_PARTE_SPECIFICA_ADD, env.apsHelper,
  67.                         null, false, endpointtype);

  68.         String responseInputMode = conn.getRisposta() != null ? StatoFunzionalita.ABILITATO.toString() : StatoFunzionalita.DISABILITATO.toString();
  69.        
  70.         String responseInputFileName = null;
  71.         String responseInputFileNameHeaders = null;
  72.         boolean responseInputDeleteAfterRead = false;
  73.         String responseInputWaitTime = null;
  74.        
  75.         if(conn.getRisposta() != null) {
  76.             responseInputFileName = conn.getRisposta().getFile();
  77.             responseInputFileNameHeaders = conn.getRisposta().getFileHeaders();
  78.             responseInputDeleteAfterRead = conn.getRisposta().isDeleteAfterRead();
  79.             responseInputWaitTime = conn.getRisposta().getWaitIfNotExistsMs() != null ? conn.getRisposta().getWaitIfNotExistsMs() + "" : null;
  80.         }
  81.        
  82.         String createParentDir = conn.getRichiesta().isCreateParentDir() != null ? ServletUtils.boolToCheckBoxStatus(conn.getRichiesta().isCreateParentDir()) : ServletUtils.boolToCheckBoxStatus(false);
  83.         String overwriteIfExists = conn.getRichiesta().isOverwriteIfExists() != null ? ServletUtils.boolToCheckBoxStatus(conn.getRichiesta().isOverwriteIfExists()) : ServletUtils.boolToCheckBoxStatus(false);
  84.        
  85.         return env.saHelper.endPointCheckData(
  86.                 null,
  87.                 env.tipo_protocollo,
  88.                 erogazione,
  89.                 endpointtype,
  90.                 null,
  91.                 null,   // nome
  92.                 null,   // tipo
  93.                 null,   // httpConf.getUsername()
  94.                 null,   // httpConf.getPassword()
  95.                 null,   // this.initcont,
  96.                 null,   // this.urlpgk,
  97.                 null,   // provurl jms,
  98.                 null,   // connfact,
  99.                 null,   // sendas,
  100.                 null,                                                   // this.httpsurl,
  101.                 null,   // httpsConf.getTipologia().toString(),
  102.                 false,      // this.httpshostverify,
  103.                 ConnettoriCostanti.DEFAULT_CONNETTORE_HTTPS_TRUST_VERIFY_CERTS, // httpsTrustVerifyCert
  104.                 null,   // this.httpspath
  105.                 null,   // this.httpstipo,
  106.                 null,   // this.httpspwd,
  107.                 null,   // this.httpsalgoritmo
  108.                 false,
  109.                 null,
  110.                 "",                                                                     // httpspwdprivatekeytrust,
  111.                 null,   // pathkey
  112.                 null,   // this.httpstipokey
  113.                 null,   // this.httpspwdkey
  114.                 null,   // this.httpspwdprivatekey,  
  115.                 null,   // this.httpsalgoritmokey,
  116.                 null,   // httpsKeyAlias
  117.                 null,   // httpsTrustStoreCRLs
  118.                 null,   // httpsTrustStoreOCSPPolicy
  119.                 null,   // httpsKeyStoreBYOKPolicy
  120.                 null,                                                               //  tipoconn (personalizzato)
  121.                 ServletUtils.boolToCheckBoxStatus(false),                                           //autenticazioneHttp,
  122.                 ServletUtils.boolToCheckBoxStatus(false),  
  123.                 null,   // evalnull( () -> proxy.getHostname() ),
  124.                 null,   // evalnull( () -> proxy.getPorta().toString() ),
  125.                 null,   // evalnull( () -> proxy.getUsername() ),
  126.                 null,   // evalnull( () -> proxy.getPassword() ),
  127.                 ServletUtils.boolToCheckBoxStatus(false), //ServletUtils.boolToCheckBoxStatus( tempiRisposta_enabled ),
  128.                 null,   // evalnull( () -> timeoutConf.getConnectionTimeout().toString()),  // this.tempiRisposta_connectionTimeout,
  129.                 null,   // evalnull( () -> timeoutConf.getConnectionReadTimeout().toString()), //null,  // this.tempiRisposta_readTimeout,
  130.                 null,   // evalnull( () -> timeoutConf.getTempoMedioRisposta().toString()), // this.tempiRisposta_tempoMedioRisposta,
  131.                 "no",   // this.opzioniAvanzate,
  132.                 "",     // this.transfer_mode,
  133.                 "",     // this.transfer_mode_chunk_size,
  134.                 "",     // this.redirect_mode,
  135.                 "",     // this.redirect_max_hop,
  136.                 conn.getRichiesta().getFile(),  // this.requestOutputFileName,
  137.                 conn.getRichiesta().getFilePermissions(),   // this.requestOutputFileName_permissions
  138.                 conn.getRichiesta().getFileHeaders(),   // this.requestOutputFileNameHeaders,
  139.                 conn.getRichiesta().getFileHeadersPermissions(),   // this.requestOutputFileNameHeaders_permissions
  140.                 createParentDir,
  141.                 overwriteIfExists,
  142.                 responseInputMode,  // this.responseInputMode,
  143.                 responseInputFileName,  // this.responseInputFileName,
  144.                 responseInputFileNameHeaders,   // this.responseInputFileNameHeaders,
  145.                 ServletUtils.boolToCheckBoxStatus(responseInputDeleteAfterRead),    // this.responseInputDeleteAfterRead,
  146.                 responseInputWaitTime,  // this.responseInputWaitTime,
  147.                 false, // autenticazioneToken
  148.                 null, // tokenPolicy
  149.                 null, // autenticazioneApiKey
  150.                 false, // useOAS3Names
  151.                 false, // useAppId
  152.                 null, // apiKeyHeader
  153.                 null, // apiKey,
  154.                 null, // appIdHeader,
  155.                 null, // appId,
  156.                 listExtendedConnettore, // listExtendedConnettore
  157.                 false, // erogazioneServizioApplicativoServerEnabled,
  158.                 null // erogazioneServizioApplicativoServer
  159.             );

  160.     }

  161.     @Override
  162.     public Connettore fillConnettoreRegistro(org.openspcoop2.core.registry.Connettore regConnettore,
  163.             ErogazioniEnv env,
  164.             ConnettoreFile conn,
  165.             String oldConnT) throws Exception {
  166.         final String endpointtype = TipiConnettore.FILE.getNome();
  167.        
  168.         org.openspcoop2.core.registry.Connettore conTmp = null;
  169.         List<ExtendedConnettore> listExtendedConnettore =
  170.                 ServletExtendedConnettoreUtils.getExtendedConnettore(conTmp, ConnettoreServletType.ACCORDO_SERVIZIO_PARTE_SPECIFICA_ADD, env.apsHelper,
  171.                         null, false, endpointtype);

  172.         String responseInputMode = conn.getRisposta() != null ? StatoFunzionalita.ABILITATO.toString() : StatoFunzionalita.DISABILITATO.toString();
  173.        
  174.         String responseInputFileName = null;
  175.         String responseInputFileNameHeaders = null;
  176.         boolean responseInputDeleteAfterRead = false;
  177.         String responseInputWaitTime = null;
  178.        
  179.         if(conn.getRisposta() != null) {
  180.             responseInputFileName = conn.getRisposta().getFile();
  181.             responseInputFileNameHeaders = conn.getRisposta().getFileHeaders();
  182.             responseInputDeleteAfterRead = conn.getRisposta().isDeleteAfterRead();
  183.             responseInputWaitTime = conn.getRisposta().getWaitIfNotExistsMs() != null ? conn.getRisposta().getWaitIfNotExistsMs() + "" : null;
  184.         }
  185.        
  186.        
  187.         String createParentDir = conn.getRichiesta().isCreateParentDir() != null ? ServletUtils.boolToCheckBoxStatus(conn.getRichiesta().isCreateParentDir()) : ServletUtils.boolToCheckBoxStatus(false);
  188.         String overwriteIfExists = conn.getRichiesta().isOverwriteIfExists() != null ? ServletUtils.boolToCheckBoxStatus(conn.getRichiesta().isOverwriteIfExists()) : ServletUtils.boolToCheckBoxStatus(false);

  189.         env.apsHelper.fillConnettore(
  190.                 regConnettore,
  191.                 conn.isDebug() != null && conn.isDebug() ? "true" : "false",                // this.connettoreDebug,
  192.                 endpointtype,           // endpointtype
  193.                 oldConnT,           // oldConnT
  194.                 "",                     // tipoConn Personalizzato
  195.                 null, // this.url,
  196.                 null,   // this.nome,
  197.                 null,   // this.tipo,
  198.                 null,
  199.                 null,
  200.                 null,   // this.initcont,
  201.                 null,   // this.urlpgk,
  202.                 null,   // this.url,
  203.                 null,   // this.connfact,
  204.                 null,   // this.sendas,
  205.                 null,                                               // this.httpsurl,
  206.                 null,  //this.httpstipologia
  207.                 false,  // this.httpshostverify,
  208.                 ConnettoriCostanti.DEFAULT_CONNETTORE_HTTPS_TRUST_VERIFY_CERTS, // httpsTrustVerifyCert
  209.                 null,  // this.httpspath
  210.                 null,  //this.httpstipo,
  211.                 null,  //this.httpspwd,
  212.                 null,  // this.httpsalgoritmo
  213.                 false,
  214.                 null, // this.httpskeystore,
  215.                 "",                                                                 //  this.httpspwdprivatekeytrust
  216.                 null,  //pathkey
  217.                 null,  //this.httpstipokey
  218.                 null,  //this.httpspwdkey
  219.                 null,  //this.httpspwdprivatekey,  
  220.                 null,  //this.httpsalgoritmokey,
  221.                 null,  //httpsKeyAlias
  222.                 null,  //httpsTrustStoreCRLs
  223.                 null,  //httpsTrustStoreOCSPPolicy
  224.                 null,  //httpsKeyStoreBYOKPolicy
  225.            
  226.                 ServletUtils.boolToCheckBoxStatus( false ),
  227.                 null,
  228.                 null,
  229.                 null,
  230.                 null,
  231.                 ServletUtils.boolToCheckBoxStatus( false ),
  232.                 null,
  233.                 null,
  234.                 null,
  235.                 "no",   // this.opzioniAvanzate,
  236.                 "",     // this.transfer_mode,
  237.                 "",     // this.transfer_mode_chunk_size,
  238.                 "",     // this.redirect_mode,
  239.                 "",     // this.redirect_max_hop,
  240.                 conn.getRichiesta().getFile(),  // this.requestOutputFileName,
  241.                 conn.getRichiesta().getFilePermissions(),   // this.requestOutputFileName_permissions
  242.                 conn.getRichiesta().getFileHeaders(),   // this.requestOutputFileNameHeaders,
  243.                 conn.getRichiesta().getFileHeadersPermissions(),   // this.requestOutputFileNameHeaders_permissions
  244.                 createParentDir,    // this.requestOutputParentDirCreateIfNotExists,
  245.                 overwriteIfExists,  // this.requestOutputOverwriteIfExists,
  246.                 responseInputMode,  // this.responseInputMode,
  247.                 responseInputFileName,  // this.responseInputFileName,
  248.                 responseInputFileNameHeaders,   // this.responseInputFileNameHeaders,
  249.                 ServletUtils.boolToCheckBoxStatus(responseInputDeleteAfterRead),    // this.responseInputDeleteAfterRead,
  250.                 responseInputWaitTime,  // this.responseInputWaitTime,
  251.                 null,   // tokenPolicy
  252.                 null, null, // apiKeyHeader,  apiKeyValue
  253.                 null, null, // appIdHeader, appIdValue
  254.                 null, // connettoreStatusParams
  255.                 listExtendedConnettore);    
  256.         return regConnettore;
  257.     }

  258.     @Override
  259.     public org.openspcoop2.core.config.Connettore buildConnettoreConfigurazione(
  260.             org.openspcoop2.core.config.Connettore regConnettore, ErogazioniEnv env, ConnettoreFile conn,
  261.             String oldConnType) throws Exception {

  262.         final String endpointtype = TipiConnettore.FILE.getNome();
  263.        
  264.         org.openspcoop2.core.registry.Connettore conTmp = null;
  265.         List<ExtendedConnettore> listExtendedConnettore =
  266.                 ServletExtendedConnettoreUtils.getExtendedConnettore(conTmp, ConnettoreServletType.ACCORDO_SERVIZIO_PARTE_SPECIFICA_ADD, env.apsHelper,
  267.                         null, false, endpointtype);

  268.         String responseInputMode = conn.getRisposta() != null ? StatoFunzionalita.ABILITATO.toString() : StatoFunzionalita.DISABILITATO.toString();
  269.        
  270.         String responseInputFileName = null;
  271.         String responseInputFileNameHeaders = null;
  272.         boolean responseInputDeleteAfterRead = false;
  273.         String responseInputWaitTime = null;
  274.        
  275.         if(conn.getRisposta() != null) {
  276.             responseInputFileName = conn.getRisposta().getFile();
  277.             responseInputFileNameHeaders = conn.getRisposta().getFileHeaders();
  278.             responseInputDeleteAfterRead = conn.getRisposta().isDeleteAfterRead();
  279.             responseInputWaitTime = conn.getRisposta().getWaitIfNotExistsMs() != null ? conn.getRisposta().getWaitIfNotExistsMs() + "" : null;
  280.         }
  281.        
  282.        
  283.         String createParentDir = conn.getRichiesta().isCreateParentDir() != null ? ServletUtils.boolToCheckBoxStatus(conn.getRichiesta().isCreateParentDir()) : ServletUtils.boolToCheckBoxStatus(false);
  284.         String overwriteIfExists = conn.getRichiesta().isOverwriteIfExists() != null ? ServletUtils.boolToCheckBoxStatus(conn.getRichiesta().isOverwriteIfExists()) : ServletUtils.boolToCheckBoxStatus(false);

  285.         env.apsHelper.fillConnettore(
  286.                 regConnettore,
  287.                 conn.isDebug() != null && conn.isDebug() ? "true" : "false",                // this.connettoreDebug,
  288.                 endpointtype,           // endpointtype
  289.                 oldConnType,            // oldConnT
  290.                 "",                     // tipoConn Personalizzato
  291.                 null, // this.url,
  292.                 null,   // this.nome,
  293.                 null,   // this.tipo,
  294.                 null,
  295.                 null,
  296.                 null,   // this.initcont,
  297.                 null,   // this.urlpgk,
  298.                 null,   // this.url,
  299.                 null,   // this.connfact,
  300.                 null,   // this.sendas,
  301.                 null,                                               // this.httpsurl,
  302.                 null,  //this.httpstipologia
  303.                 false,  // this.httpshostverify,
  304.                 ConnettoriCostanti.DEFAULT_CONNETTORE_HTTPS_TRUST_VERIFY_CERTS, // httpsTrustVerifyCert
  305.                 null,  // this.httpspath
  306.                 null,  //this.httpstipo,
  307.                 null,  //this.httpspwd,
  308.                 null,  // this.httpsalgoritmo
  309.                 false,
  310.                 null, // this.httpskeystore,
  311.                 "",                                                                 //  this.httpspwdprivatekeytrust
  312.                 null,  //pathkey
  313.                 null,  //this.httpstipokey
  314.                 null,  //this.httpspwdkey
  315.                 null,  //this.httpspwdprivatekey,  
  316.                 null,  //this.httpsalgoritmokey,
  317.                 null,  //httpsKeyAlias
  318.                 null,  //httpsTrustStoreCRLs
  319.                 null,  //httpsTrustStoreOCSPPolicy
  320.                 null,  //httpsKeyStoreBYOKPolicy
  321.            
  322.                 ServletUtils.boolToCheckBoxStatus( false ),
  323.                 null,
  324.                 null,
  325.                 null,
  326.                 null,
  327.                 ServletUtils.boolToCheckBoxStatus( false ),
  328.                 null,
  329.                 null,
  330.                 null,
  331.                 "no",   // this.opzioniAvanzate,
  332.                 "",     // this.transfer_mode,
  333.                 "",     // this.transfer_mode_chunk_size,
  334.                 "",     // this.redirect_mode,
  335.                 "",     // this.redirect_max_hop,
  336.                 conn.getRichiesta().getFile(),  // this.requestOutputFileName,
  337.                 conn.getRichiesta().getFilePermissions(),   // this.requestOutputFileName_permissions
  338.                 conn.getRichiesta().getFileHeaders(),   // this.requestOutputFileNameHeaders,
  339.                 conn.getRichiesta().getFileHeadersPermissions(),   // this.requestOutputFileNameHeaders_permissions
  340.                 createParentDir,    // this.requestOutputParentDirCreateIfNotExists,
  341.                 overwriteIfExists,  // this.requestOutputOverwriteIfExists,
  342.                 responseInputMode,  // this.responseInputMode,
  343.                 responseInputFileName,  // this.responseInputFileName,
  344.                 responseInputFileNameHeaders,   // this.responseInputFileNameHeaders,
  345.                 ServletUtils.boolToCheckBoxStatus(responseInputDeleteAfterRead),    // this.responseInputDeleteAfterRead,
  346.                 responseInputWaitTime,  // this.responseInputWaitTime,
  347.                 null,   // tokenPolicy
  348.                 null, null, // apiKeyHeader,  apiKeyValue
  349.                 null, null, // appIdHeader, appIdValue
  350.                 null, // connettoreStatusParams
  351.                 listExtendedConnettore);    
  352.         return regConnettore;
  353.     }

  354.     @Override
  355.     public ConnettoreFile buildConnettore(Map<String, String> props, String tipo) {
  356.         ConnettoreFile c = new ConnettoreFile();

  357.         c.setTipo(ConnettoreEnum.FILE);
  358.         c.setDebug(Boolean.parseBoolean(props.get(CostantiDB.CONNETTORE_DEBUG)));

  359.         ConnettoreFileRichiesta richiesta = new ConnettoreFileRichiesta();

  360.         richiesta.setFile(props.get(CostantiDB.CONNETTORE_FILE_RESPONSE_INPUT_FILE));
  361.         richiesta.setFileHeaders(props.get(CostantiDB.CONNETTORE_FILE_RESPONSE_INPUT_FILE_HEADERS));
  362.         String requestOutputFileName = props.get(CostantiDB.CONNETTORE_FILE_REQUEST_OUTPUT_FILE);  
  363.         String requestOutputFileName_permissions = props.get(CostantiDB.CONNETTORE_FILE_REQUEST_OUTPUT_FILE_PERMISSIONS);  
  364.         String requestOutputFileNameHeaders = props.get(CostantiDB.CONNETTORE_FILE_REQUEST_OUTPUT_FILE_HEADERS);    
  365.         String requestOutputFileNameHeaders_permissions = props.get(CostantiDB.CONNETTORE_FILE_REQUEST_OUTPUT_FILE_HEADERS_PERMISSIONS);    
  366.         String v = props.get(CostantiDB.CONNETTORE_FILE_REQUEST_OUTPUT_AUTO_CREATE_DIR);
  367.         boolean requestOutputParentDirCreateIfNotExists = false;        
  368.         if(v!=null && !"".equals(v)){
  369.             if("true".equalsIgnoreCase(v) || CostantiConfigurazione.ABILITATO.getValue().equalsIgnoreCase(v) ){
  370.                 requestOutputParentDirCreateIfNotExists = true;
  371.             }
  372.         }                  
  373.         v = props.get(CostantiDB.CONNETTORE_FILE_REQUEST_OUTPUT_OVERWRITE_FILE);
  374.         boolean requestOutputOverwriteIfExists = false;
  375.         if(v!=null && !"".equals(v)){
  376.             if("true".equalsIgnoreCase(v) || CostantiConfigurazione.ABILITATO.getValue().equalsIgnoreCase(v) ){
  377.                 requestOutputOverwriteIfExists = true;
  378.             }
  379.         }  

  380.         v = props.get(CostantiDB.CONNETTORE_FILE_RESPONSE_INPUT_MODE);
  381.         boolean responseInputMode = false;
  382.         if(v!=null && !"".equals(v)){
  383.             if("true".equalsIgnoreCase(v) || CostantiConfigurazione.ABILITATO.getValue().equalsIgnoreCase(v) ){
  384.                 responseInputMode = true;
  385.             }
  386.         }

  387.         richiesta.setFile(requestOutputFileName);
  388.         richiesta.setFilePermissions(requestOutputFileName_permissions);
  389.         richiesta.setFileHeaders(requestOutputFileNameHeaders);
  390.         richiesta.setFileHeadersPermissions(requestOutputFileNameHeaders_permissions);
  391.         richiesta.setCreateParentDir(requestOutputParentDirCreateIfNotExists);
  392.         richiesta.setOverwriteIfExists(requestOutputOverwriteIfExists);

  393.         c.setRichiesta(richiesta);


  394.         if(responseInputMode){
  395.             boolean responseInputDeleteAfterRead = false;
  396.             String responseInputFileName = props.get(CostantiDB.CONNETTORE_FILE_RESPONSE_INPUT_FILE);
  397.             String responseInputFileNameHeaders = props.get(CostantiDB.CONNETTORE_FILE_RESPONSE_INPUT_FILE_HEADERS);
  398.             v = props.get(CostantiDB.CONNETTORE_FILE_RESPONSE_INPUT_FILE_DELETE_AFTER_READ);
  399.             if(v!=null && !"".equals(v)){
  400.                 if("true".equalsIgnoreCase(v) || CostantiConfigurazione.ABILITATO.getValue().equalsIgnoreCase(v) ){
  401.                     responseInputDeleteAfterRead = true;
  402.                 }
  403.             }                      
  404.             String responseInputWaitTime = props.get(CostantiDB.CONNETTORE_FILE_RESPONSE_INPUT_WAIT_TIME);

  405.             ConnettoreFileRisposta risposta = new ConnettoreFileRisposta();

  406.             risposta.setFile(responseInputFileName);
  407.             risposta.setFileHeaders(responseInputFileNameHeaders);

  408.             if(responseInputWaitTime != null && !responseInputWaitTime.isEmpty()) {
  409.                 risposta.setWaitIfNotExistsMs(Integer.parseInt(responseInputWaitTime));
  410.             }
  411.             risposta.setDeleteAfterRead(responseInputDeleteAfterRead);

  412.             c.setRisposta(risposta);
  413.         }

  414.         return c;
  415.     }

  416.     @Override
  417.     public String getUrlConnettore(Map<String, String> properties, String tipoConnettore) throws Exception {
  418.         return "[file] " + properties.get(CostantiDB.CONNETTORE_FILE_REQUEST_OUTPUT_FILE);
  419.     }

  420. }