How to check if IMAPFolder is hidden? - jakarta-mail

How may I check if a javax.mail.Folder or com.sun.mail.imap.IMAPFolder object in JavaMail API represents a hidden folder?

There's no universal notion of "hidden folder".
If your IMAP server is using UNIX files, you can check that the folder/file name starts with a dot.
What sort of IMAP server are you using? Do you have existing folders that are "hidden"?

Related

Editing Google Docs Files Through Batch File

Is it possible to edit a text file (*.txt) that's public for editing in google Docs through Cmd or a batch file. Or Can I use the FTP Command? It can even be done by uploading and downloading the same file (Download, Edit, Upload).
I have made the Document That I want to add text to and re-upload it per say. https://drive.google.com/file/d/0B0qbLnCcNlcMQ1VSQkFoSmJxc1k/view?usp=sharing
As well as the ftp side goes, afaik google docs don't support ftp access
But a 3rd party program called Cyberduck comes handy at this point
So passing some arguments to cyberduck might do the trick
But if you also want to access a 3rd party ftp server
than it is also possible using the ftp command

How to create .msg file in java using javax mail API

I just wanted to know, is it possible to create .msg file(that can be opened using ms-outlook) using javax mail API.
Thanks.
I believe a .msg file is in a Microsoft proprietary format; there's no easy way to create such a file with JavaMail.
However, Outlook might be able to read a .eml file, which is in MIME standard format. JavaMail can create such a file using the Message.writeTo method.
There is a project on javamail.
The module javamail-file-transport is a JavaMail transport that creates msg files on local disk instead of sending real email.
GitHub: https://github.com/m-szalik/javamail
Hi, can we create an .eml file that cen be opened using outlook.If yes then how...
You can open files from the command line in Outlook. Search for Command-line switches for Outlook There is a undocumented /eml switch that can be used to open the MIME standard format. For example, outlook /eml filename.eml
There is a documented /f switch which will open msg files. For example outlook /f filename.msg
Other alternatives:
Free: jotlmsg
Commercial: Aspose.Email

Guidelines to follow when making your program Active Directory/Terminal Services compatible

Wondering if there's any guidelines that should be followed when writing an application that should work not only on a plain ol' non-networked computer but also on a computer/network that is setup with Active Directory (or some other directory service) and/or Terminal Services? Anything I should look out for, be aware of, etc?
Microsoft has renamed Terminal Services to 'Remote Desktop Services' so searching and looking around MSDN my not be as constructive using the old terminology.
I'd start having a look around Remote Desktop Services Programming Guidelines found here:
http://msdn.microsoft.com/en-us/library/aa383490(VS.85).aspx
On the AD site a starting point would be here:
[http://msdn.microsoft.com/en-us/library/ms682458(VS.85).aspx][2]
The most important things to be aware of:
On a Terminal Server users are not admins, they have no rights to:
Write in Program files folder
Register ActiveX controls
Write into (ini files) in Windows(\System32)
HKLM hive of the registry
Some other points:
- Certain API's like getting the Windows directory will return redirected results (in this case the windows subfolder of the homedrive) UNLESS you mark your executable as Terminal Server aware
- Your application must not rely on settings in HKCU that prevent startup when not present
- Multiple users might use your app concurrently so each user must be able to have their own settings (in HKCU)

Icons from remote files

I have started coding an FTP client application (for fun). I’m trying to represent remotely hosted files with icons. For example, let’s say I’m browsing the root folder of an FTP server (/) and want to display the Backup.zip file with the icon association from that client operating system. On some systems, this may be the windows compression icon and other operating systems this may be WinZip or WinRAR icons.
I have the client browsing local files with the SHGetFileInfo() function. This works great with files that are local, however, this function requires the physical file in order to retrieve the associated icon. So, this will not work with remotely hosted files. I have found some samples of loading icons given a file extension, and this is really where the question comes in... What would be the best strategy to get icons associated to remote files?
Go to the registry every time and look up extension to icon associations
Create 1 byte files with each extension and use the SHGetFileInfo() function for remote files (using local 1 byte files as association for remote files)
Other strategies???
What would a professional software company creating an FTP client do?
Thank you for your time.
-Jessy Houle
I suggest that you don't go to the registry every time: go if you need to, but if you've already been for a given filetype then remember/cache that result (within your program) and reuse it.
Use the procedure here from a previous Stack Overflow question on the same idea and uses the registry instead of an actual file.
How can I get the filetype icon that Windows Explorer shows?

Round trip editing of binary documents stored on a server

I'm looking to build some functionality for a content management system for the editing of files stored on the server.
I'd like to provide users the ability to easily download files locally to their computer, open the file for editing, and save it back to the server. The process should be as seamless as possible.
Here's the steps today:
Click the link to download the file (say a PSD) in a web browser
Save it to disk
Find the file, open it for editing in Photoshop
Make changes, save the file
Go back to the browser,navigate to the file that was downloaded.
Click "replace file"
Find the file, upload it back to the server.
Here's what I want:
Click the link to open the PSD file
File is downloaded, Photoshop launches
Make changes, save the file
File is uploaded back to server, replacing the original file
Those who have used Sharepoint know that this works (using WebDAV) but only with the Office applications (PPT, DOC, XLS). I'd like it to work with all file types.
This will take some kind of software to be installed locally - perhaps a separatly installed application with a mime type registered, a signed java applet, or a firefox extension.
This seems like a problem that should have been solved. Has anyone seen this done before?
Windows client OS has a WebDAV redirector and has had for a long time, so
a) you shouldnt need a client piece and b) it's not specific to Office files.
The fun bit is the server end, implementing a WebDAV server.
WebDAV isnt supported on client OSs like Vista (IIS5.1 has support, 6.0 doesnt), only on Servers (2K3, 2K8...)
There is goo/examples/frameworks (cant recall which from when I researched it) available for implementing a WebDAV server, but it requires a server OS [so I had to discount it as the host in my case could potentially have been Vista/7, not server/XP).
The site WebDAV Resources includes a link to at least one open-source server implementation. I haven't used this software, I'm just citing the reference.
It appears that Apache has deprecated or dropped support for server-side WebDAV since the Jakarta Slide project has been retired.

Resources