Results 1 to 3 of 3

Thread: How to set username & password that a file server folder requires

  1. #1
    Join Date
    Aug 2012
    Posts
    1

    Default How to set username & password that a file server folder requires

    Hi guys!

    Iīm new to Spring Integration and I have the following concern as I couldnīt find a solution to it. I need to leave a file (after itīs processed) into a specific folder that is located in a file server. The matter is that this folder asks for permissions (username & password) in order to be written. Could you please tell me where and how to set this configuration? I provide you with a copy of my spring-integration.xml below:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:int="http://www.springframework.org/schema/integration"
    xmlns:jdbc="http://www.springframework.org/schema/integration/jdbc"
    xmlns:stream="http://www.springframework.org/schema/integration/stream"
    xmlns:int-xml="http://www.springframework.org/schema/integration/xml"
    xmlns:file="http://www.springframework.org/schema/integration/file"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/integration http://www.springframework.org/schem...ntegration.xsd
    http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schem...ation-jdbc.xsd
    http://www.springframework.org/schem...gration/stream http://www.springframework.org/schem...ion-stream.xsd
    http://www.springframework.org/schema/integration/xml http://www.springframework.org/schem...ration-xml.xsd
    http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd">

    <!-- Log interceptors -->
    <int:logging-channel-adapter id="loggerEntrada" log-full-message="true"/>

    <!-- Gets rows from a table -->
    <int:channel id="jdbcChannel">
    <int:interceptors>
    <int:wire-tap channel="loggerEntrada"/>
    </int:interceptors>
    </int:channel>
    <jdbc:inbound-channel-adapter
    query="SELECT
    (select OrigenCodigoCOTA from OrganismosPublicos.Origen where OrigenId = 1 ) as origenId,
    (select ProcedenciaCodigoCOTA from OrganismosPublicos.Procedencia where ProcedenciaId = 1 )as procedenciaId,
    TipoDeInstancia.TipoDeInstanciaCodigo as codigoTipoInstancia,
    Cliente.ClienteCodigoCOTA as numeroClienteCOTA,
    SUBSTRING ( cast (Denunciante.DenuncianteAni as varchar(10)),1,2) as aniCodigoArea,
    SUBSTRING ( cast (Denunciante.DenuncianteAni as varchar(10)),3,4) as aniPrefijo,
    SUBSTRING ( cast (Denunciante.DenuncianteAni as varchar(10)),7,4)as aniSufijo,
    HEN.HistorialDeEstadoDeNotaFechaDeCambioDeEstado as fechaIngresoNota,
    'OP105131-00-001 - bpm para cnc.- servicio de Pioneer ' as codigoContactoPioneer,
    null as Id
    FROM OrganismosPublicos.HistorialDeEstadoDeNota HEN
    left join OrganismosPublicos.Nota Nota ON HEN.NotaId = Nota.NotaID
    left join OrganismosPublicos.Denunciante Denunciante ON Nota.DenunciaID = Denunciante.DenunciaID
    left join OrganismosPublicos.TipoDeInstancia TipoDeInstancia ON TipoDeInstancia.TipoDeInstanciaId = Nota.TipoDeInstanciaID
    left join OrganismosPublicos.Cliente Cliente ON Denunciante.ClienteId = Cliente.ClienteID
    WHERE (HEN.EstadoId = 1 or HEN.EstadoId = 14)
    and HEN.HistorialDeEstadoDeNotaFechaDeCambioDeEstado &lt; dateadd(hh, ${com.tm.denuncias.periodoHorasReporteContactos} ,getDate())"

    channel="jdbcChannel" data-source="defaultDataSource"
    row-mapper="registroReporteContactoRowMapper">
    <int: poller cron="0 0 0/${com.tm.denuncias.periodoHorasReporteContactos} * * ?" >
    <int:transactional />
    </int: poller>
    </jdbc:inbound-channel-adapter>

    <!-- Transformer which converts data into a file -->
    <int:transformer id="dataToFileTransformer" ref="registroReporteContactoToFileTransformerImpl" input-channel="jdbcChannel"
    method="transform" output-channel="toFolder"/>

    <!-- Sends file to folder -->
    <int:channel id="toFolder">
    <int:interceptors>
    <int:wire-tap channel="loggerEntrada"/>
    </int:interceptors>
    </int:channel>
    <file:outbound-channel-adapter channel="toFolder" directory="${com.tm.denuncias.directorioReporteCon tactos}" auto-create-directory="true" />

    </beans>

    Thanks a lot in advance! Much appreciated it! If you need further info please let me know.

    Best regards,

    TJ
    Last edited by TeeJay; Aug 6th, 2012 at 03:44 PM.

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,142

    Default

    There's no way to challenge for user credentials in this case.

    Either run the job under the account that has permissions to write to that directory or use an ftp server (to localhost) where you can provide such credentials.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,142

    Default

    Just to clarify - I mean replace the file:outbound-channel-adapter with an ftp:outbound-channel-adapter pointing to localhost. This requires you to be running an ftp server locally.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •