I'm looking at using javamail to download email/gmail using imap in a swing application.
According to the FAQ on javamail http://www.oracle.com/technetwork/java/faq-135477.html#localprovs I'm going to need a "local store provider", does anyone have any recommendations or advice on ones to avoid / choose?
I had presumed that I would just store the messages in a database - is that a bad idea?
I'm really looking for the simpest solution I can find - but actually works!
Both JavaMailDir and Plexus mentioned in the other answers should work. However, I will add that after working with both (for reading messages from an actual inbox, not just as a local store) JavaMailDir seems to have some issues running on Windows. Particularly with the fact that the ".INBOX" folder begins with a dot.
JavaMaildir seems to be simple enough as you want from the examples
The full list of providers is on the Sun website.
Two providers I know:
Mstor: mbox provider
plexus: maildir provider, not much doc available
Related
Is it possible to receive object content change events from an LDAP server? Basically, I'm searching for a solution to integrate light weight directory services with our software via JNDI to setup active directory synchronization. (i.e. I'd like for the consumer application to be notified when a new entry is made or an object state has changed)
Below are a few possibilities I've came up with so far:
Enable auditing policy on directory objects and register a listener to read incoming changes from the change log.
Implement persistent search against the directory.
Mechanism to poll the directory for changes.
Could someone with more intimate knowledge of LDAP care recommending an optimal approach to a novice person like me?
Thanks in advance!
I'm not an ultimate expert on the topic, but I've had very similar requirements in my previous project, and made a thorough research on possible ways to implement synchronization from Active Directory. As far as I know, there is no other solution than the three options you listed above.
I think the third option is the most viable in most of the cases. It's not very difficult to implement the polling logic yourself, but you might be interested in a small java library that already does most of the hard work. It can help you getting started with change tracking in Active Directory very quickly.
Check it out here: https://github.com/zagyi/adsync4j
Disclaimer: I'm the author of the library and would love to get some feedback if you end up making use of it.
Your best bet with Microsoft Active Directory is to implement the DirSync Control.
Not sure of code in JNDI to implement DirSync Control but I know there is an implementation with UNBOUNDID LDAP SDK.
-jim
I am using docx4j to load, manipulate and save Word files. Everything works perfectly but there is one thing i don't know how to implement it.
What I want is something like a version control - that means if you save a document it shall be possible to recover a earlier version of this document (e.g. by saving only the delta). Maybe you can describe it that is should be something like SVN or Git where you can go back to an earlier version of your files.
The problem is that i do not know any possibility to realize that. So I hope that anyone of you can help me. It would be fine if anyone at least know a package or something else that can do this with files in general and not especially with the docx Files.
Thanks for your help!
Edit: I am sorry that my question was imprecise. This was my first post here, in future i will improve ;)
JGit is a Java implementation of Git that will work with few dependencies. Similar libraries exist for SVN and CVS. Home-brewing a version control system is almost certainly a terrible idea, given the existence of good-quality solutions!
If you'd like some pure java implementatoin for document versioning, maybe you could go for: Jackrabbit
Similar questions have been already asked before. The 1.st answer (marked as correct one) on this question goes for Jackrabbit as well: Using a version control system as a data backend
I think you should use Git for this, I found a Java API called JavaGit, so you can have easy access the repository.
With Git you can have a local repository where you can commit files and switch versions. If you need it you could also push and pull the data to a remote location.
Better use JGit like Gian said!
The simplest possible way would be to use tools diff and patch. They were used as a core of CVS. I assume that you would like to run your application in Windows where they are not preinstalled. I don't know whether it would be easy / comfortable to use windows versions of this tools but you can always try to write similiar functionality on your own. Here you can find very good tutorial about finding differences between files and patching them: http://tuts.pinehead.tv/2012/09/18/introduction-using-diff-and-patch/ When you know the functionality it's quite easy to write something similiar on your own.
This can be a tricky thing to implement yourself, so I wouldn't recommend it.
I don't know much about your environment, but if you are able to use an off-the-shelf versioning repository, you'll save yourself much grief. You can try to use Git or SVN directly, which may be the simplest solution for your use case.
Since you're talking about MS Office files, however, you may be implementing some form of enterprise document management tool. In this case, the JCR specification is designed to provide access to files in a repository, with versioning and other metadata features. Here's the specification.
The Apache Jackrabbit project provides an open source implementation of this spec, as does the developers version of Alfresco.
Picking the right solution will really depend on what your users are trying to do with these files, what your deployment environment looks like (don't try to host Git on Windows, k?), and how custom your current codebase is (standard Servlet container? Java EE? home-rolled?).
Good luck!
In order to work with AD's Global Catalog from a Java program , I am required to perform a CLDap (Connectionless ldap) call from my Java program.
I am looking for some open source to perform this task, but in vain.
Has someone experienced creating CLDAP connection in Java and can help around?
Many thanks
Zaske
Surprising requirement. CLDAP was moved to 'historic status' in 2003, see RFC 3352. Based on that, (a) I doubt you will ever see a Java API for it, and (b) I would just use LDAP over TCP: it will work at least as well. See also here where its removal from OpenLDAP is discussed.
I'm totally new to this PCOMM things so I have a question. I'm using the "Personal Communications" Software by IBM. I also have an Visual Basic PCOMM sript which I want to rewrite in java.
Is there some kind of documentation of how to do this?
When I google with the query PCOMM Documentation I've got the Personal Communications for Windows, Version 5.6 - Quick Beginnings and when use Goolge Books I can come around 2 articles on InfoWorld.
Why not you can try for? I think it would be helpful...
I found some Links in my research to it...
I mostly struggled with having no javadoc in the past and explored the library to see what works but in the below links there is the javadoc for it ;-)
I've written a library to easily do testautomation on the mainframe but it's company specific and closed source, anyway you can get back to me if you have a question and I see if I can answer i.
Just one note on multithreading:
Basically it is possible but the native library gets loaded once and used for all threads and this lib is not thread safe.
If you do multithreading, you have totake care that you don't try to interact with two mainframe sessions at the same time.
I just implemented an managing wueue where the threads request for a slot and then go to wait state and the managing thread just loops over the queue, wakes the specific thread and waits until he gives the slot back (just make sure you can't get into a deadlock).
Due to stackoverflow hyperlinks restriction, find all link here: http://nopaste.info/ed31e94351.html
The most important one (at least for me) is the javadoc inside the hacl.zip file on the ftp:
ftp://public.dhe.ibm.com/software/webserver/hostondemand/library/
According to IBM's Personal Communications Host Access Class Library book:
The documentation for the HACL Java classes is provided in HTML
format. These files are available in the ..\doc\hacl subdirectory of
the Personal Communications installation image. To view the
documentation, use a Web browser to view the ECLReference.html file,
which is the first file of the softcopy HACL Java reference.
Does anyone have links and resources to connect to an AS400 from Java?
I remember years ago, somebody told me about a connector that simulates KeyStrokes from the keyboard and other "purest" approach that connected directly.
On the web I have found a lot of links, but I cannot find a complete product to do this (I am probably not using the right keywords).
EDIT
Thanks for the answers:
What we are looking for is a way to access the data inside the AS400 and/or the screens it uses and expose them for other new applications re-use. Either as a webservice of some sort, or directly through Java ( and java will expose the operations using webservices )
Thanks in advance.
EDIT
As per MicSim post, I've also found this link:
http://www.ibm.com/developerworks/library/ws-as400/index.html
What you are looking for is probably the Toolbox for Java™ & JTOpen from IBM. There is also an AS400 class in the toolbox for performing specific AS400 tasks. You can look here and here for more details. Just googled it and hope it's helpful.
IBM's 5250 screen-scraping technology was "WebFacing" - I would post a link but you're probably better off Googling it, since IBM's documentation is so scattered. There are other technologies available too but: Screen-scraping was never anyone's favourite since typically you end up with something which, although it looks more up-to-date, actually is harder to use than a green screen and no more functional. The 5250 is probably the single best data entry platform I've ever used - web forms in a browser are one of the worst.
As mentioned, jt400 is the way to go for most other things. In particular:
JDBC - for all things SQL. If you do it right and address your files as though they really are tables, it's a way to get away from the 400 entirely.
Record-level access - write Java programs using a similar database API to RPGLE (all those chains, setlls that 400 programmers love)
Call programs, system commands, manage resources (data queues, data areas, prints / spools, jobs etc etc)
Good luck
If you just want to run Java on the AS/400 (or iSeries, or System i, or whatever IBM's marketing department has decided to call it this month), that's a supported language. You can access the pseudo-DB2 database directly. Or are you after some other form of integration?
This obviously depends on what you want to do, however if you want to simulate keystrokes across a network connection to an AS400 process then Expect4j may be the library you are looking for.
This is generally a really nasty hack though and there are frequently better ways to achieve your goals. What are you trying to do?
The expect4J library can be found here. Expect was originally a unix command that allowed you to specify a string that you are expecting to see and then a string of characters to return. It was frequently used for automating logins etc and for screen-scraping applications.
Even better is the TN5250j Console, which can be used to extract data from the AS/400.
jacada makes tools to do what your looking for
http://www.jacada.com/