How to prevent caching of Http Authentication

Hello all,
I'm having trouble with a custom wrapper for the URL object that I wrote which is to be run from a multi-threaded program. Basically what I have is an application server that interacts w/ native code through message queueing. As the application server gets a request from the queue it starts a thread that invokes my URL wrapper. My URL wrapper has code to set the authentication (userid/pwd) based on info given from the app server which is read from the queue. It all works fine until the credentials change (a new user/pwd). The credentials from the 1st request are used. I'm betting that even if I use my wrapper object single threaded it won't work because it doesn't seem to allow the credentials to change. The only way I know of setting the credentials is through the default authenticator and it doesn't seem like this object is subject to change.
The following is a subset of my custom URL wrapper object:
public class HttpRequestObject
     private URL urlObj = null;
     private StringBuffer urlString = new StringBuffer();
     private InputStream input = null;
     private URLConnection urlCon = null;
     public HttpRequestObject(String url)
          urlString.append(url.trim());
     private class HTTPAuthenticator extends java.net.Authenticator
          private String userid;
          private String password;
          public HTTPAuthenticator(String name, String pwd)
               userid = name;
               password = pwd;
          protected java.net.PasswordAuthentication getPasswordAuthentication()
               return new java.net.PasswordAuthentication(userid,password.toCharArray());
     public boolean openConnection(String name, String pwd)
          java.net.Authenticator.setDefault(new HTTPAuthenticator(name,pwd));
          return this.openConnection();
     public boolean openConnection()
          try
               urlObj = new URL(urlString.toString());
               urlCon = urlObj.openConnection();
               input = urlCon.getInputStream();
               return true;
          catch(Exception e)
               System.out.println(e.getMessage());
               e.printStackTrace();
               return false;
          finally
               java.net.Authenticator.setDefault(new HTTPAuthenticator(" "," "));
}I'm not comfortable with this design at all because it feels too disconnected. There appears to be too big a possibility of credentials being shared between threads where each thread should maintain its own set of credentials. Please help.
Cliff

Hallo,
you have to ask for new username and password in your getPasswordAuthentication() or you have to set your new username and password in your getPasswordAuthentication. You don't have to use a new Authenticator object in order to authenticate a different user. That won't work.
Take a look at this site, there you will see, how to create your own Authenticator: http://java.sun.com/features/2002/11/hilevel_network.html
Hope this helps,
Hobster

Similar Messages

  • How do we determine the HTTP authentication header for our hosted solution?

    How do we determine the HTTP authentication header (adobeconnect_admin_httpauth) from our hosted solution? The documentation says to find it in a custom.ini file but I have no clue how to access that.
    I need to supply that to the adobeconnect plugin used with a Moodle instance, screnshot below.
    If it helps, when I click "Test Connection", I see the following output.
    A series of tests have been run in order to determine whether the Adobe Connect Pro server has been properly setup for this integration to work and to also determine whether the user credentials provided in the activity global settings has the correct permissions to perform the neccessary tasks required by the activity module. If any of the tests below have failed, this activity module will not function properly.
    For further assistance and documentation in how to set up your Adobe Connect Pro server please consult the MoodleDocs help page for this activity module Help page
    Sending common-info call:
    successfully obtained the session key: na11breezrirhb4f4ryf5shqy
    successfully logged in as admin user
    Testing retrevial of shared content, recording and meeting folders:
    error obtaining shared content folder
    XML request:
    <?xml version="1.0" encoding="UTF-8"?> <params><param name="action">sco-shortcuts</param></params>
    XML response:
    <?xml version="1.0" encoding="utf-8"?> <results><status code="no-access" subcode="no-login"/></results>
    error obtaining forced-archives (meeting recordings) folder
    XML request:
    <?xml version="1.0" encoding="UTF-8"?> <params><param name="action">sco-shortcuts</param></params>
    XML response:
    <?xml version="1.0" encoding="utf-8"?> <results><status code="no-access" subcode="no-login"/></results>
    error obtaining meetings folder
    XML request:
    <?xml version="1.0" encoding="UTF-8"?> <params><param name="action">sco-shortcuts</param></params>
    XML response:
    <?xml version="1.0" encoding="utf-8"?> <results><status code="no-access" subcode="no-login"/></results>
    error creating meeting testmeetingtest folder
    XML request:
    <?xml version="1.0" encoding="UTF-8"?> <params><param name="action">sco-update</param><param name="type">meeting</param><param name="name">testmeetingtest</param><param name="folder-id"/><param name="date-begin">2015-03-14T06:53:39.000+00:00</param><param name="date-end">2015-03-14T07:53:39.000+00:00</param></params>
    XML response:
    <?xml version="1.0" encoding="utf-8"?> <results><status code="invalid"><invalid field="folder-id" type="id" subcode="format"/></status></results>
    error creating user testusertest
    XML request:
    <?xml version="1.0" encoding="UTF-8"?> <params><param name="action">principal-update</param><param name="first-name">testusertest</param><param name="last-name">testusertest</param><param name="login">[email protected]</param><param name="password">9B396EA828A00203FB3E8E69010FE537</param><param name="extlogin">[email protected]</param><param name="type">user</param><param name="send-email">false</param><param name="has-children">0</param><param name="email">[email protected]</param></params>
    XML response:
    <?xml version="1.0" encoding="utf-8"?> <results><status code="no-access" subcode="no-login"/></results>
    What are we missing?
    Thanks!

    Here is the docuementation for loging in with an HTTP Headder Adobe Connect 9 * Log in from an application
    Seeing as there may be some modification to files on the server, you may need to work with Adobe Support to see if they can be modified in the Hosted environment.Adobe Connect Help | Adobe Connect Support

  • Adobe AIR - How to prevent caching?

    Hello,
    We use Adobe AIR as a one-site-browser for our users.
    which means that all of the content and data reside in our server and all they have, installed on their PC, is an iframe.
    From time to time we encounter issues with users who can't get our application working, or get an older version of our pages.
    What we saw after investigation is that the pages are being cached and stored in the Temporary Internet Files folder (where IE keeps its cache).
    When the user try to clear the Browsing History from inside IE it does not clear our pages from the cache, only manual delete works.
    We tried to add the following meta to our pages with no success:
    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    The manual deletion is not a solution, is there a way to make Adobe AIR not to save our pages (.html and .js files) in the cache?
    Please Advice,
    Uri

    Hello Jeff,
    Thank you for your quick respond.
    I'm not sure how can I implement what you've suggested.
    As I mentioned on my original post, I use Adobe AIR as a "gateway" to a special area in our website.
    Which means basically that all that there is in the AIR application is an iframe.
    I don't know how can I implement the cacheResponse and useCache properties if all I have is an iframe.
    Please help,
    Uri

  • How to prevent caching?

    the browser caches the information and so i have to do a refresh every once in a while to update the dynamically changing information.

    hello
    it kinda doesn't work
    you see, i have links sorted according to the number of hits.
    This is how it looks like for example
    Link1
    Link2
    Link3
    Link4
    now if lets say Link2 has 10 hits and Link3 has 9.
    If i click Link3, then the hits become 10 and if i click it again, it becomes 11.
    but it still looks like above when its supposed to be
    Link1
    Link3
    Link2
    Link4
    it doesn't show the right order until i refresh the page.
    and the thing is, if i don't refresh the page, then when i click Link3, it shows the url of link2....

  • How to prevent caching of URL?

    Hello,
    I have an application developed using Flex SDK 3.2 that calls a java servlet using navigateToURL. The servlet returns a generated PDF file, but after the first call the response is getting cached. I'm not sure if this a problem with Flex, Java or Tomcat. I have tried setting response parameters in the servlet (seHeader("Pragma","no-cache")) etc and tried a similar approach in the client - new URLRequestHeader("pragma", "no-cache");.
    Anyway, no matter what I do I can't stop the caching and I;m hoping someone can help.
    Thanks.
    JJ

    You can append the random number to the url something like this
    var str:string = "http://someurl.com?rndm="+Math.random()*100

  • Bypass the http authentication on router

    Hi
    how could i bypass the http  authentication on router , i tried the below command but in vain
    no ip http authentication local
    thanks

    Hello Bilal
    Not sure I understand your question ? - The OP has asked can you connect to the http server without authentication.
    I understand by that they are asking how to connect to the http server via port 80 (router that is) - so disabling authentication and  http-secure-server(if enable) and defaulting to port 80 with let you connect .
    By the way congratulations on your CCIE accreditation very well done - I believe your  in your only early 20's as well - So a future quadruple CCIE maybe?
    Exceptional achievement Bilal !
    res
    Paul

  • How to prevent IE Caching ???

    Hi AIl,
    I am using dhtmlX tree , to display tree in first jsp and loading the tree using xml file, but when i go to second jsp and come back to first one, i have some changes in the xml file and thus creating new xml file and string on disk to load the new xml again to form the tree in first jsp, but the problem is, due to the IE caching its taking the old xml file from Temporary Internet files folder and thus changes will not reflect... question is how can I prevent this caching of xml file in that folder ......
    I tried this but not working
    <%
    response.setHeader("Cache-Control","no-cache");
    response.setHeader("Pragma","no-cache");
    response.setDateHeader ("Expires", -1);
    %>
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    my page body
    </BODY>
    <HEAD>
    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    </HEAD>
    </HTML>
    Many thanks in advance !!!

    prashant-kadam wrote:
    I am using dhtmlX tree , to display tree in first jsp and loading the tree using xml file, but when i go to second jsp and come back to first one, i have some changes in the xml file and thus creating new xml file and string on disk to load the new xml again to form the tree in first jsp, but the problem is, due to the IE caching its taking the old xml file from Temporary Internet files folder and thus changes will not reflect... question is how can I prevent this caching of xml file in that folder ......So the JSP page should load the XML itself and not the webbrowser? How have you confirmed that the problem is with IE? Have you tried another webbrowsers? Have you tried restarting the appserver after XML change and before using IE?
    response.setHeader("Cache-Control","no-cache");
    response.setHeader("Pragma","no-cache");
    response.setDateHeader ("Expires", -1);Looking good.
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    </BODY>
    <HEAD>
    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    </HEAD>
    </HTML>Shouting in HTML is not needed, it's soo 1990s.

  • How to set expiry time for cached Subjects of authenticated proxy service.

    How to set expiry time for cached Subjects of authenticated proxy service in message level authentication.
    Because of this, password change does not effect immediatly in proxy invocation.
    I'm using Weblogic 10.3 and OSB3.0

    Hi,
    You can activate Time-Dependent Publishing Service on your XML form and once the Lifetime of Documents is over then the document is not visible to users.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c1/c87d3cf8ff3934e10000000a11405a/frameset.htm
    It is only invisible but not deleted!
    So to delete all expired XML Forms you should run Scheduler Tasks for Time-Dependent Publishing:
    <b>TimeBasePublishingUnpublish</b>
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3a/bc37b5789dee4eaa8005bff84f14cf/frameset.htm
    You can also create your own Scheduler Task which deletes/archieves all expired XML Forms.
    Greetings,
    Praveen Gudapati
    [Points are welcome for helpful answers]

  • Multiple podcast login windows cause iTunes to be unresponsive.  How to prevent attempt of authentication from unsubsribed podcasts?

    I have several podcasts that I have been storing following the subscription service.  These podcasts in recent updates to iTunes have been attempting logging on (for what I assume) to check for updates to the podcasts.  This occurs at initialization of iTunes and at periodic intervals while iTunes is running.  When the login/password window appears, iTunes becomes unresponsive.  Any media that is currently playing continues to play, but cannot be paused, fast forwarded, etc.  After a period of time, iTunes becomes responsive, it can take 10+ minutes.  At this time, I can cancel the login windows by hitting cancel the number of times I have individual password protected podcasts (that I do not have active usernames/passwords for).
    I have opened the settings for each podcast and they are all "unsubscribed" and have set every setting that I can find so that the podcasts do not update, but I am still getting prompts to login causing iTunes to be unresponsive.
    I do not want to delete the podcasts, because I still want to use the podcasts and associated podcast documents.  Any suggestions on how to prevent the podcasts from attempting to authenticate?
    Note that I have had these podcasts for >1yr as unsubscribed podcasts and have not had this issue until recent updates to iTunes.  (Since 11.1 or 11.2.)

    I've had a problem similar to yours since the iTunes update in January 2014.  I have not subscribed to any paid podcasts...mine are all free, and I don't recall that any have needed a password.  Since January, when I have iTunes open and click on Podcasts, I get a pop-up window that says "Authentication Required" needing username and password.  I can try 5 times with entering username/password, then iTunes locks-up, and if I click cancel on the pop-up window, iTunes locks-up.  I start Task Manager then alt/control/delete...that's the way I have to close out the iTunes window.  Any updates since January has not fixed the problem.  In about mid May, quite by surprise, I clicked on podcasts and it opened without the pop-up window showing and I was able to click on any of my podcasts.  After another update, I was back to the same problem.  The problem has to be with that update in January.  If you run across a "fix" for the problem, please post, I'd really like to get my iTunes working again.  I use Windows 7.

  • How to prevent the Firefox cache from clearing -- all settings are right, but the cache is gone after each restart.

    I want to prevent cache from being deleted after each restart. "Clear history when Firefox closes" is unchecked. User.js files are deleted. Checking "Override automatic cache management" made Cache folder appear in addition to Cache2. After exiting Cache is still there, but upon Firefox re-launching, Cache turns into Cache.Trash and promptly disappears. What to do?

    Hello,
    I'm sorry to hear that. Can you please try these solution to address your concern.
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from [https://www.mozilla.org mozilla.org] (or choose the download for your operating system and language from [https://www.mozilla.org/firefox/all/ this page]) and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (or open the Firefox menu [[Image:New Fx Menu]] and click the close button [[Image:Close 29]]).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    More information about reinstalling Firefox can be found [[Troubleshoot and diagnose Firefox problems#w_5-reinstall-firefox|here]].
    <b>WARNING:</b> Do not use a third party uninstaller as part of this process. Doing so could permanently delete your [[Profiles|Firefox profile]] data, including but not limited to, extensions, cache, cookies, bookmarks, personal settings and saved passwords. <u>These cannot be easily recovered unless they have been backed up to an external device!</u> See [[Back up and restore information in Firefox profiles]]. <!-- Starting in Firefox 31, the Firefox uninstaller no longer lets you remove user profile data.Ref: Bug 432017 and https://support.mozilla.org/kb/uninstall-firefox-from-your-computer/discuss/5279 [Fx31] Windows uninstaller will no longer offer the option to remove personal data -->
    Please report back to say if this helped you!
    Thank you.

  • HTTP Authentication Methods

    Testing HTTP Authentication Methods for URL https://mail.domain.co.nz/rpc/rpcproxy.dll?cl-cas01.domain.local:6002.
    The HTTP authentication test failed.
    Tell me more about this issue and how to resolve it
    Additional Details
    Not all the required authentication methods were found.
    Methods Found: Negotiate
    Methods Required: NTLM
    Any ideas how to get around this with the exchange connectivity tester? If I change from negotiate to basic or ntlm, I then have issues with clients on the local network.

    This link does not work. Could you update this post with the information that helped fix your issue? I am receiving the same error. Everything works internally. I have a casarray with 3 client access servers. If I try and connect using Outlook Anywhere externally,
    all the tests pass except for the last one which states:
    Testing HTTP Authentication Methods for URL https://casarray.mydomain.com/rpc/rpcproxy.dll?casarray.mydomain.com:6002.
    The HTTP authentication test failed.
    Additional Details
    An HTTP 500 response was returned from Unknown.
    HTTP Response Headers:
    Content-Length: 3423
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Date: Tue, 03 Jun 2014 01:59:11 GMT
    Server: Microsoft-IIS/7.5
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Elapsed Time: 2135 ms.
    Here is the full test:
    Testing RPC/HTTP connectivity.
    The RPC/HTTP test failed.
    Additional Details
    Elapsed Time: 10139 ms.
    Test Steps
    Attempting to resolve the host name casarray.mydomain.com in DNS.
    The host name resolved successfully.
    Additional Details
    IP addresses returned: MyIpAddress
    Elapsed Time: 262 ms.
    Testing TCP port 443 on host casarray.mydomain.com to ensure it's listening and open.
    The port was opened successfully.
    Additional Details
    Elapsed Time: 213 ms.
    Testing the SSL certificate to make sure it's valid.
    The certificate passed all validation requirements.
    Additional Details
    Elapsed Time: 1347 ms.
    Test Steps
    The Microsoft Connectivity Analyzer is attempting to obtain the SSL certificate from remote server casarray.mydomain.com on port 443.
    The Microsoft Connectivity Analyzer successfully obtained the remote SSL certificate.
    Additional Details
    Remote Certificate Subject: CN=casarray.mydomain.com, OU=Domain Control Validated - RapidSSL(R), OU=See www.rapidssl.com/resources/cps (c)14, OU=GT62161020, SERIALNUMBER=4/00u9cheL7q8Gq41IXnlvVd8mb8-rjb, Issuer: CN=RapidSSL CA, O="GeoTrust, Inc.", C=US.
    Elapsed Time: 1260 ms.
    Validating the certificate name.
    The certificate name was validated successfully.
    Additional Details
    Host name casarray.mydomain.com was found in the Certificate Subject Common name.
    Elapsed Time: 0 ms.
    Certificate trust is being validated.
    The certificate is trusted and all certificates are present in the chain.
    Test Steps
    The Microsoft Connectivity Analyzer is attempting to build certificate chains for certificate CN=casarray.mydomain.com, OU=Domain Control Validated - RapidSSL(R), OU=See www.rapidssl.com/resources/cps (c)14, OU=GT62161020, SERIALNUMBER=4/00u9cheL7q8Gq41IXnlvVd8mb8-rjb.
    One or more certificate chains were constructed successfully.
    Additional Details
    A total of 1 chains were built. The highest quality chain ends in root certificate CN=GeoTrust Global CA, O=GeoTrust Inc., C=US.
    Elapsed Time: 32 ms.
    Analyzing the certificate chains for compatibility problems with versions of Windows.
    Potential compatibility problems were identified with some versions of Windows.
    Additional Details
    The Microsoft Connectivity Analyzer can only validate the certificate chain using the Root Certificate Update functionality from Windows Update. Your certificate may not be trusted on Windows if the "Update Root Certificates" feature isn't enabled.
    Elapsed Time: 4 ms.
    Testing the certificate date to confirm the certificate is valid.
    Date validation passed. The certificate hasn't expired.
    Additional Details
    The certificate is valid. NotBefore = 5/6/2014 10:15:31 AM, NotAfter = 5/9/2015 5:16:00 PM
    Elapsed Time: 0 ms.
    Checking the IIS configuration for client certificate authentication.
    Client certificate authentication wasn't detected.
    Additional Details
    Accept/Require Client Certificates isn't configured.
    Elapsed Time: 6179 ms.
    Testing HTTP Authentication Methods for URL https://casarray.mydomain.com/rpc/rpcproxy.dll?casarray.mydomain.com:6002.
    The HTTP authentication test failed.
    Additional Details
    An HTTP 500 response was returned from Unknown.
    HTTP Response Headers:
    Content-Length: 3423
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Date: Tue, 03 Jun 2014 01:59:11 GMT
    Server: Microsoft-IIS/7.5
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Elapsed Time: 2135 ms.

  • How to prevent computers to logon remote site's domain controllers

    Hi,
    We have 3 sites (HQ, remote site A and remote site B) in a Windows 2008 r2 domain, the clients are win XP and win 7, if remote site A's DC and HQ's DC are offline, we don't want remote site B's DC to authenticate
    remote site A and HQ client, how to prevent remote site B's DC to authenticate remote site A and HQ client except remote site B local client?
    Regards,
    Ray NG.

    You might consider configuring ACLs on your firewalls and network equipment to filter this traffic. However, the idea of having multiple DCs is to have HA while in this case you are trying to avoid having benefit of this feature. For Windows clients, they
    will keep using cached credentials as long as they cannot reach a DC for authentication.
    If you would like to configure ACLs to achieve that, please do not restrict the communication between the DCs themselves.
    This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
    Get Active Directory User Last Logon
    Create an Active Directory test domain similar to the production one
    Management of test accounts in an Active Directory production domain - Part I
    Management of test accounts in an Active Directory production domain - Part II
    Management of test accounts in an Active Directory production domain - Part III
    Reset Active Directory user password

  • WLS 5.1 and prevent caching on cache server

    Hi,
    Is there any method to prevent caching for *.jar files or any other
    static resources on client side cache server ?
    It seems to be possible by making filter programs that insert
    statement <meta http-equiv="Pragma" content="no-cache">
    into http response header if using WLS 7.1
    but we are using WLS5.1 SP13.

    I'm running native io. How would I use green threads with jdk1.3?
    I didn't think I could.
    thanks,
    lisa
    Chris Shipman <[email protected]> wrote:
    are you runing native io, or running green threads? try
    green threads.
    Lisa Klag wrote:
    I'm having problems getting WLS to run under JDK 1.3.I keep getting
    the following exception:
    Tue Feb 27 15:55:00 GMT+00:00 2001:<A> <SSLListenThread>ListenThread.run()
    failed:
    java.lang.UnsatisfiedLinkError: /opt/weblogic/5.10/lib/linux/libweblogicunix1.so:
    /opt/weblogic/5.10/lib/linux/libweblogicunix1.so: undefinedsymbol:
    makeCString
    at java.lang.ClassLoader$NativeLibrary.load(NativeMethod)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1306)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at weblogic.platform.Unix.<init>(Unix.java:14)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:237)
    at weblogic.platform.OperatingSystem.getOS(OperatingSystem.java:77)
    at weblogic.t3.srvr.T3Srvr$1.run(T3Srvr.java:1160)
    at weblogic.t3.srvr.Callback.done(Callback.java:37)
    at weblogic.t3.srvr.SSLListenThread.newServerSocket(SSLListenThread.java:474)
    at weblogic.t3.srvr.ListenThread.run(ListenThread.java:245)

  • How to prevent a solaris user to telnet from multiple computers

    Hello,
    How to prevent Solaris users to telnet from multiple computers? They should be able to telnet from only one PC.
    Please help..

    ora_tech have a good point, i was about to suggest ipfilter, which is a built-in-firewall in Solaris, but using tcp wrappers would probably be easier. It all depends on which level of security you want (blocking the telnet requests in a firewall would generally be safer than blocking them at the tcp wrapper level, since its prevents some processing).
    Since Solaris 10 you can also easily enable tcp wrappers on the inetd services with inetadm, see:
    http://blogs.sun.com/gbrunett/entry/tcp_wrappers_on_solaris_10
    .. for more details..
    .7/M.

  • How can I Cache the data I'm reading from a collection of text files in a directory using a TreeMap?

    How can I Cache the data I'm reading from a collection of text files in a directory using a TreeMap? Currently my program reads the data from several text files in a directory and the saves that information in a text file called output.txt. I would like to cache this data in order to use it later. How can I do this using the TreeMap Class? These are the keys,values: TreeMap The data I'd like to Cache is (date from the file, time of the file, current time).
    import java.io.*;
    public class CacheData {
      public static void main(String[] args) throws IOException {
      String target_dir = "C:\\Files";
      String output = "C:\\Files\output.txt";
      File dir = new File(target_dir);
      File[] files = dir.listFiles();
      // open the Printwriter before your loop
      PrintWriter outputStream = new PrintWriter(output);
      for (File textfiles : files) {
      if (textfiles.isFile() && textfiles.getName().endsWith(".txt")) {
      BufferedReader inputStream = null;
      // close the outputstream after the loop
      outputStream.close();
      try {
      inputStream = new BufferedReader(new FileReader(textfiles));
      String line;
      while ((line = inputStream.readLine()) != null) {
      System.out.println(line);
      // Write Content
      outputStream.println(line);
      } finally {
      if (inputStream != null) {
      inputStream.close();

    How can I Cache the data I'm reading from a collection of text files in a directory using a TreeMap? Currently my program reads the data from several text files in a directory and the saves that information in a text file called output.txt. I would like to cache this data in order to use it later. How can I do this using the TreeMap Class?
    I don't understand your question.
    If you don't know how to use TreeMap why do you think a TreeMap is the correct solution for what you want to do?
    If you are just asking how to use TreeMap then there are PLENTY of tutorials on the internet and the Java API provides the methods that area available.
    TreeMap (Java Platform SE 7 )
    Are you sure you want a map and not a tree instead?
    https://docs.oracle.com/javase/tutorial/uiswing/components/tree.html

Maybe you are looking for