directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Sindberg (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (FC-143) Let LdapClientTrustStoreManager read trust store from jar
Date Fri, 29 Jan 2016 07:26:39 GMT

    [ https://issues.apache.org/jira/browse/FC-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15123133#comment-15123133
] 

Jan Sindberg edited comment on FC-143 at 1/29/16 7:25 AM:
----------------------------------------------------------

I think that I made a last minute change that I shouldn't have done. I forgot about files
outside classpath. Also I can't remember why I have to test with the pushback input stream
- I think that is a bit theoretic situation like pointing to a web-resource that doesn't exist.

We could probably boil it down to 

{code}
  private InputStream getInputStream(String _fileName)
  {
    InputStream result = null;
    final File file = new File(_fileName);
    if (file.exists())
    {
      try
      {
        result = new FileInputStream(file);
      }
      catch (FileNotFoundException e)
      {
        // Don't care
      }
    }
    else
    {
      result = this.getClass().getClassLoader().getResourceAsStream(_fileName);
    }
    return result;
  }
{code}


was (Author: jan.sindberg@gmail.com):
I think that I made a last minute change that I shouldn't have done. I forgot about files
outside classpath. Also I can't remember why I have to test with the pushback input stream
- I think that is a bit theoretic situation like pointing to a web-resource that doesn't exist.

We could probably boil it down to 

{code}
  private InputStream getInputStream(String _fileName)
  {
    InputStream result = null;
    final File file = new File(_fileName);
    if (file.exists())
    {
      try
      {
        result = new FileInputStream(file);
      }
      catch (FileNotFoundException e)
      {
        // Don't care
      }
    }
    else
    {
      result = this.getClass().getClassLoader().getResourceAsStream(_fileName);
    }
    return result;
  }
{/code}

> Let LdapClientTrustStoreManager read trust store from jar
> ---------------------------------------------------------
>
>                 Key: FC-143
>                 URL: https://issues.apache.org/jira/browse/FC-143
>             Project: FORTRESS
>          Issue Type: Improvement
>    Affects Versions: 1.0.0-RC41
>            Reporter: Jan Sindberg
>            Priority: Minor
>             Fix For: 1.0.0-RC41
>
>         Attachments: [FC-143]_-_Let_LdapClientTrustStoreManager_read_trust_store_from_jar.patch
>
>
> *Use case *
> Creating a small utility to initialize configuration (setting system properties) which
serves up the right parameters and also contains trust stores.
> That way we can quickly set up for test locally at developer machines, as well on test
environments and prod.
> *Problem*
> LdapClientTrustStoreManager expects a fully-qualified name of a Java TrustStore on local
file system.
> *Proposed solution*
> Get an input stream to the trust store. Test if it is a local file. If it is not, then
test if an inputstream can be created from resources.
> Patch attached.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message