GetReceivedDate not working with local file

hello :)
im using this code to define a local file as MimeMEssage that i read in via StdIn.
     BasicConfigurator.configure();
     Session mailSession = Session.getInstance(new Properties());
             InputStream source = System.in;
              MimeMessage message = new MimeMessage(mailSession, source);This works very well and i can use all methods MimeMessage offers.
except one:
        Date maildate = message.getReceivedDate();i always get null here.
GetSentDate works fine.
and all the other get methods i tried.
when i fetch this mail via the javamaildir class i have no problems getting the receivedDate.
Does javamail need a real provider here?

Pop3 doesn't support for getReceivedDate method (Imap supported)
You can get received date on message's headers
This is my snip code
private static Date getDateHeader(javax.mail.Message msg) throws MessagingException {
Date today = new Date();
String[] received = msg.getHeader("received");
if(received != null)
for (int i = 0; i < received.length; i++) {
String dateStr = null;
try {
dateStr = getDateString(received);
if(dateStr != null) {
Date msgDate = parseDate(dateStr);
if(!msgDate.after(today))
return msgDate;
} catch(ParseException ex) { }
String[] dateHeader = msg.getHeader("date");
if(dateHeader != null) {
String dateStr = dateHeader[0];
try {
Date msgDate = parseDate(dateStr);
if(!msgDate.after(today)) return msgDate;
} catch(ParseException ex) { }
return today;
private static String getDateString(String text) {
String[] daysInDate = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
int startIndex = -1;
for (int i = 0; i < daysInDate.length; i++) {
startIndex = text.lastIndexOf(daysInDate[i]);
if(startIndex != -1)
break;
if(startIndex == -1) {
return null;
return text.substring(startIndex);
private static Date parseDate(String dateStr) throws ParseException {
SimpleDateFormat dateFormat ;
try {
dateFormat = new SimpleDateFormat("EEE, d MMM yy HH:mm:ss Z") ;
return dateFormat.parse(dateStr);
} catch(ParseException e) {
try {
dateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z") ;
return dateFormat.parse(dateStr);
} catch(ParseException ex) {
dateFormat = new SimpleDateFormat("d MMM yyyy HH:mm:ss Z") ;
return dateFormat.parse(dateStr);

Similar Messages

  • Flash Preloader Not Working with Local Files?

    Hello all,
    I have created a digital resumé using a Flash
    presentation. The presentation links to several SWF files that are
    rather large. I have designed and implemented preloaders for the
    files.
    My intent is to burn the whole product to CD for
    distribution. The problem I am having is that my Flash preloaders
    work perfectly in FireFox; I click the button in the main
    presentation and the preloader comes up in the target screen,
    followed by the SWF.
    However, the preloaders do not work at all in IE, which
    leaves a black pane with nothing in it and causes the user to click
    the button several times trying to figure out why nothing is
    happening.
    The Flash presentation that is being displayed is embedded in
    a HTML document. The user clicks a button to load a SWF to a
    separate screen; the preloader runs until the file is loaded.
    Any help you could provide is appreciated.

    I have attached the actionscript for the data connection. The
    odd thing about this issue is some of the data is being displayed
    from the webservice call and then some is not. The drop down list
    is not being populated but I am getting some text in a textarea
    that is on the form. My datasource is a SQL Server database and in
    ColdFusion administrator, I used the actual machine name to point
    to the datasource because it is directly linked to my web server.
    This configuration is the one giving me problems. If I change the
    datasource to my test SQL Server (server.somewhere.com) it works
    fine. Does this help any?

  • Javascript not working with local files

    I am not able to get Firefox to execute javascript on local files. I have disabled all add-ons. The odd thing was, the first time I disabled all of the add-ons, it worked, then I re-enabled them one by one to see which one was causing the problem, it stopped, I disabled them all again so I could confirm that is was the add-on, and after that I have never been able to get any javascript to run.
    I have tried multiple files, even the most basic one listed in the Javascript tutorials, no luck. Chrome and Opera have no problems.

    Hi,
    why didn't you check the sy-batch (test if it's a background job) ? 
    use the DIR_TEMP of the SAP server when it's a background job.
    to get the physical directory you could use this kernel function :
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TEMP'
                         ID 'VALUE' FIELD searchpoints-dirname.
    (dirname is a CHAR 75)
    Rgd
    Frédéric

  • Has anyone not working with .dv files had synchronization problems?

    Has anyone not working with .dv files had sound synchronization problems? I'm not exactly sure what the alternatives to DV are, but I think one of them is HD.
    The reason for asking this question is to help isolate the nature and cause of a very serious flaw in iMovie '11. In the original release of iMovie '11 (version 9.0) there was a small--but serious--synchronization problem. In the 9.01 there is a large synchronization problem. We know of one person who has not experienced the problem, and he is not working with DV files (media). So we want to find out if anyone who is using something other than .dv files is experiencing a lack of synchronization between sound and picture. Knowing the answer to this will help with figuring out where the cause lies. For the initial iMovie '11 release (9.0), you probably would not notice a problem unless you had very long event-clips, e.g., two hours long. Events get this long if you are transferring from analog 8 mm tapes. Even then, it would have to be in scenes in which the connection between event and sound is obvious, e.g., close ups of people talking. It isn't until the 9.01 release that most people would notice anything. All we need to do is establish one case of a synchronization problem in which the person is using something other than DV.
    Message was edited by: Paul Bullen

    Hopefully, the 9.0.2 release will make my question moot. Zyfert must have posted the announcement of the release just as I was formulating my question. Still, if you have information on the subject, it would be interesting to hear.

  • Quicklook does not work with WMV files and quick look no longer maintains resized views when viewing from a folder using the up/down arrows

    Quicklook does not work with WMV files and quick look no longer maintains resized views when viewing from a folder using the up/down arrows. Any fixes?

    Same problem here...

  • Working with local files at c:\temp ...

    Hi!
    My report is working with local files (this is a must). I know that i can't use such a report in a planned job in the background. Are there nevertheless any options for me starting this report regularly in an automatic way? ...Perhaps on a pc which is always logged/switched on?
    Thanks in advance!
    Best regards,
    Ingo

    Hi,
    why didn't you check the sy-batch (test if it's a background job) ? 
    use the DIR_TEMP of the SAP server when it's a background job.
    to get the physical directory you could use this kernel function :
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TEMP'
                         ID 'VALUE' FIELD searchpoints-dirname.
    (dirname is a CHAR 75)
    Rgd
    Frédéric

  • Validation Event Handler Not working with Flat File GTC Trusted Recon

    We are created Event Handler for checking special characters in Telephone field.Its working fine when the user is created through Admin Console.but the event handler is not triggering while doing GTC Flat File Trusted recon.
    Version: OIM 11.1.1.5.0
    Can someone please help me out with this.
    Thanks
    Edited by: 790561 on 17-Feb-2013 09:01
    Edited by: 790561 on Feb 17, 2013 9:35 PM
    Edited by: 790561 on Feb 18, 2013 12:38 AM

    Validation Event handlers will not work with your trusted recon. You can use the GTC Validation provider, it is nothing but the plugins which you can insert with in your source field in GTC. I think you can easily get the steps for how to create a custom GTC Providers.
    Edited by: iam37 on Feb 16, 2013 4:09 PM

  • BrowserLab won't work with local files in DW CS5

    Any issue report you make about BrowserLab on these forums should minimally contain the following information. If it doesn't, the first response you get from us will likely just ask for the missing info anyway
    Subject
    A descriptive summary of the issue.
    The body should contain:
    Problem Description
    A brief description of the bug or issue
    Steps to Recreate
    The steps we should follow to reproduce your issue. Minimally include all the following:
    Does the issue happen every time, is it sporadic, or did it only happen once.
    Are you testing on Mac or Windows?
    Are you using the main BrowserLab interface, testing via Dreamweaver integration (and if so, what version of DW), or using the BrowserLab for Firebug add-on?
    What is the URL you're testing against. If it's not public, let us know and let us know if you can send us the page source.
    Expected Results
    Based on the steps you described, what you thought should happen
    Actual Results
    What actually did happen
    Thanks everyone,
    Mark
    Using BrowserLab in DW 11.0 Build 4964, BrowserLab can't seem to work. Some not very intuitive places I have checked include making sure the signon credentials are in the CSLive window in DW.
    In preview local/browser, the following messages are disappointing me:
    Timed Out, Failed to Authenticate with Browserlab
    Session Expired, See Browser
    It is on a Mac, 10.6.7, using DW integrated testing. I can log into browserlab and put a public URL, but I don't think that's going to be much better for me than having VMWare and installing free browsers on Mac and Windows, and given the failures here that would be better for local file checks too. I write this because I wonder if I will be disappointed trying to get this to work and then find out I have to pay a yearly subscription to CSLive to be able to keep using it.
    This is on a private URL and I can send the page source, but I don't think its the page that is causing the issue.
    Expected results:
    Able to preview page in any browser of my choosing
    Actual results:
    Spent the last two hours navigating help, googling possible solutions, getting many errors trying to navigate the Adobe help and forums, continually signing in on each adobe page I open. Expecting to have to reauthenticate to post this message. (Updated extension manager as well).

    Hi,
    First, there is no charge currently for using CSLive and there won't be any charge for another year.
    Second, based on what you're saying about the behavior you're seeing with BrowserLab and the issues you had with continually having to sign onto the Adobe pages, it's a strong indication that you've got cookies disabled in your browser or that something on your machine is deleting/expiring the cookies we are trying to set. What browser/version are you using and what kinds of permissions have you got set for cookies in that browser? Can you check that and change your cookie permissions for Adobe.com at least?
    Let me know if that helps or not,
    Mark

  • How to setup new site in dreamweaver if not working with Local Site Folder?

    Dear All,
    I am working with a website design (wordpress) project with a group of people, since we are working together on the same design, our developing site is not located in the local folder but on remote server, but I can't setup the website in DW if the developing site is not located locally.
    Is there any way to do the development on remote server with DW, and what will be the site setup setting for it?
    thanks for any reply.
    bruce

    Sharing a "Local" site is a recipe for disaster vis-a-vis file versioning.  The best way to avoid these problems is to have three locations defined:
    1.  A local site (truly local to your computer, although it can be on a network, shared drive).
    2.  A staging site (this would be the intermediate holding site for partially finished work.
    3.  A production site (this would be where the final versions of files are pushed).
    Enable DW's Checkin/Checkout facility.  Each of you would checkout files from the staging server, and when finished editing, checkin those same files to the staging server.  Thus, you are not sharing a local site - you are sharing a remote file repository, which is your gold standard source for version protected files.
    Make sense?

  • Working with Local Files

    I have to develop a Web-Based application to run on each client's pc. Or, it could be to run on our intranet. This is for internal use only. The requirements are very simple:
    1. Web-Based
    2. Able to access local client's files
    3. Able to upload files via FTP
    4. Able to access a MySQL database to query some data
    I recently developed a Desktop Application using Visual Basic 2008 Express .Net 3.5. It works ok. Application will look for .pdf files on a specific folder on C: drive, rename the files according to some user's input and database query result, then upload the renamed files to an FTP server. No problem. However, the company don't want a desktop application. So, my goal is to re-create the application using a new Rich Internet Application technology. I then, created a Windows User Control in VB.net 3.5 and embedded the .dll in an html page. This works great on my local development pc, however, it will have some security issues when I try to run it on our intranet. It seems like the control (Activex), will not allow access to the local files. I just need access to be able to rename files on C:, that's it. Then I came across Silverligt and Flex development software. But, after playing with flex for a little, noticed that Flex will not be my best choice to access and rename local files. Any suggestions about the technology that we should use?
    Will I be able to accomplish this type of application using a Java Applet?
    Thanks!

    Hi,
    why didn't you check the sy-batch (test if it's a background job) ? 
    use the DIR_TEMP of the SAP server when it's a background job.
    to get the physical directory you could use this kernel function :
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TEMP'
                         ID 'VALUE' FIELD searchpoints-dirname.
    (dirname is a CHAR 75)
    Rgd
    Frédéric

  • Applet showDocument not working for local files!!

    Hello:
    I wrote a signed applet that is generates html files in user temp folder (for my Win 7: C:\Users\ren\AppData\Local\Temp\jTmp\ )
    The applet is supposed to display the html files in browser by using showDocument().
    I tested it on firefox 25 and IE9 enabling pop-up windows
    However, it does nothing. Not even an exception.
    The applet fails  when running from web (but works in c:\)
    For the case, it happens the same with oracle's sample: Displaying Documents in the Browser (The Java&amp;trade; Tutorials &amp;gt;                    Deployment &amp;gt; Java …
    In this applet, if you input a local file (file:///c:/ etc) , it won't open it.
    I supposed showDocument was not subject to security restrictions, but seems the new rule is:
    -applets running locally will display all pages (web/local)
    -applets running from the web will display only web pages.
    My applet used to work fine, but in some jre7 upgrade it was broken!!
    Is this a bug or a new security issue?
    Thanks in advance!

    Did you get this resolved..
    I am using Internet Explorer v. 5.2 on Mac OS X v.10.2.8. I have successfully run an applet, using jre 1.3.1 which implements the "showDocument" method and opens a new page.
    Could you post your code..

  • Full-Text search is not working with PDF files - SQL Server 2012 64 bit

    Hi,
    We are in the process of storing PDF files in SQL Server 2012 with Full-Text search capability.
    I followed the steps as below and it works fine with word document but not for PDF files. I tried with PDF ifiler 11 & 9 and both are unsuccessful.
    Server/DB Level Settings:
    1)
    Enable FileStream
    2)
    Install Full-Text
    then restart
    3)
    Use [specific db]
    alter
    database [db name]
    add
    filegroup Files
    contains filestream;
    alter
    database [db name]
    add
    file (
    name = N'Files',
    filename =
    N'D:\SQL\DATA') to
    filegroup [Files];
    3)
    Database level
    Settings:
    FileStream:
    FileStream
    Directory name:
    [Set the name]
    FileStream
    non-transacted
    Access: [set Appropriate]
    3a)
    Add a
    datafile to DB
    with filestreamdata
    filetype.
    4)
    Share D:\SQL\DATA
    directory and
    add specific accounts
    with read/write
    access
    5)
    Give bulkadmin
    access to those
    specific accounts
    at server
    level
    6)
    From the
    page (link)
    download and
    install the *.pdf
    IFilter for
    FTS. Link:
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5542
    7)
    To the
    PATH global system
    variable add
    path to the
    catalog,
    where you installed
    the plugin.
    Default for
    this version is:
    C:\Program
    Files\Adobe\Adobe
    PDF iFilter 9
    for 64-bit
    platforms\bin
    8)
    From the
    page (link)
    download a
    FilterPackx64.exe
    and install
    it. Link:
    http://www.microsoft.com/en-us/download/confirmation.aspx?id=20109
    9)
    Now from
    SSMS execute the following
    procedures:
    -sp_fulltext_service
    'load_os_resources',1
    -sp_fulltext_service
    'verify_signature', 0
    EXEC
    sp_fulltext_service
    'update_languages';
    -- update language list
    EXEC
    sp_fulltext_service
    'restart_all_fdhosts';
    -- restart daemon
    reconfigure
    with override;
    10)
    Restart the
    server
    11)
    select document_type,
    path from
    sys.fulltext_document_types
    where document_type
    = '.pdf'
    -select
    document_type,
    path from sys.fulltext_document_types
    where document_type
    = '.docx'
    12) Results are OK.
    Following is my Table /Index/ catalog script:
    CREATE
    TABLE dbo.DocumentFilesTest
    DocumentId  INT
    IDENTITY(1,1)
    NOT NULL
    PRIMARY KEY,
    AddDate datetime
    NOT NULL,
    Name nvarchar(50)
    NOT NULL,
    Extension nvarchar(10)
    NOT NULL,
    Description nvarchar(1000)
    NULL,
    FileStream_Id UNIQUEIDENTIFIER
    ROWGUIDCOL NOT
    NULL UNIQUE DEFAULT
    NEWSEQUENTIALID(),
    FileSource varbinary(MAX)
    FILESTREAM DEFAULT(0x)
    go
    --Add default add date for document   
    ALTER
    TABLE dbo.DocumentFilesTest
    ADD CONSTRAINT
    DF_DocumentFilesTest_AddDate
    DEFAULT sysdatetime()
    FOR AddDate
    EXEC
    sp_fulltext_database
    'enable'
    GO
    IF
    NOT EXISTS
    (SELECT
    TOP 1 1 FROM sys.fulltext_catalogs
    WHERE name
    = 'Ducuments_Catalog_test')
    BEGIN
    EXEC sp_fulltext_catalog
    'Ducuments_Catalog_test',
    'create',
    'D:\SQL\PDFBlob';
    END
    --EXEC sp_fulltext_catalog 'Ducuments_Catalog_test', 'drop'
    DECLARE
    @indexName nvarchar(255)
    = (SELECT
    Top 1 i.Name
    from sys.indexes
    i
    Join sys.tables
    t on 
    i.object_id
    = t.object_id
    WHERE t.Name
    = 'DocumentFilesTest'
    AND i.type_desc
    = 'CLUSTERED')
    PRINT @indexName
    EXEC
    sp_fulltext_table
    'DocumentFilesTest',
    'create',
    'Ducuments_Catalog_test', 
    @indexName
    EXEC
    sp_fulltext_column
    'DocumentFilesTest',
    'FileSource',
    'add', 0,
    'Extension'
    EXEC
    sp_fulltext_table
    'DocumentFilesTest',
    'activate'
    EXEC
    sp_fulltext_catalog
    'Ducuments_Catalog_test',
    'start_full'
    ALTER
    FULLTEXT INDEX
    ON [dbo].[DocumentFilesTest]
    ENABLE
    ALTER
    FULLTEXT INDEX
    ON [dbo].[DocumentFilesTest]
    SET CHANGE_TRACKING
    = AUTO
    ALTER
    FULLTEXT CATALOG
    Ducuments_Catalog_test REBUILD
    WITH ACCENT_SENSITIVITY=OFF;
    INSERT
    INTO DocumentFilesTest(Extension,
    Name,
    FileSource)
    SELECT
     'pdf'
    'BOL12006553.pdf'
    * FROM
    OPENROWSET(BULK
    'd:\SQL\PDFBlob\BOL12006553.pdf',
    SINGLE_BLOB)
    AS BLOB;
    GO
    INSERT
    INTO DocumentFilesTest(Extension,
    Name,
    FileSource)
    SELECT
     'docx'
    'test.docx'
    * FROM
    OPENROWSET(BULK
    'd:\SQL\PDFBlob\test.docx',
    SINGLE_BLOB)
    AS Document;
    GO
    SELECT
    d.*
    FROM dbo.DocumentFilesTest
    d WHERE
    Contains(d.FileSource,
    'BILL')
    Returns nothing. it should come from PDF file
    SELECT
    d.*
    FROM dbo.DocumentFilesTest
    d WHERE
    Contains(d.FileSource,
    'TEST')
    Returns from word document as follows:
    2           2014-06-04 10:11:41.393            test.docx docx           
    NULL   [BINARY Value]  [Binary Value]
    Any help is appreciated. Its been a long wait.
    Thanks,
    Vel
    Vel Thavasi

    Hello,
    Did you check the fulltext log files for more details about the errors. If the filter isn’t working, there should be errors in the error log file.
    The following thread is about similar issue, please refer to:
    http://social.msdn.microsoft.com/forums/sqlserver/en-US/69535dbc-c7ef-402d-a347-d3d3e4860d72/sql-server-2008-64bit-fulltext-indexing-pdf-not-working-cant-find-ifilter
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here.
    Fanny Liu
    TechNet Community Support

  • DW9 (CS3) split view not work with ASP files?

    I just installed and ran DW CS3 (ver 9.0 bulid 3481) -- I use
    "coder" view for the screen layout. I like the split-view style
    since I code inline HTML with my ASP and ASPX code. However, the
    new version has the split-screen view button grayed out. How do I
    enable split view when I edit files that are not just ending in
    "htm" or "html" extensions? If the Adobe programmers made an
    ASSumption then they need to issue a patch and remove it pronto. I
    do not want someone else making decisions on how I do my work...I
    get enough of that from Microsoft already, I do not need it from my
    tools also. Please forward this to the developers if there is no
    way to change my preferences, otherwise please tell me how to edit
    a config file or hex-edit the executable to get this funtionality
    back. TIA!

    I still can't figure out why the split view or design view is
    grayed out and not accessible when editing files with an .asp or
    .aspx extension and it is driving me crazy! I called the support
    line and got someone in India who didn't understand my problem. 30
    minutes later I finally got her to agree to transfer me to
    secondary support but they were busy and she promised me they would
    call the next day. That was over a week ago. I didn't even get a
    voicemail, even though I stayed by my phone the whole day. I see
    that support for DW under Adobe is no better than it was under
    Macromedia...how sad. Microsoft Expression Web is looking better
    and better every day....... :(

  • Auto Sync Files not working with Local Host

    Hi,
    I am developing a site locally and testing on a local host. I have my working files in Adobe cloud and then 'upload' to my local host to test.
    This works fine when I click upload, or control+shift+u, but its extremely annoying.
    I have checked the box that says 'automatically upload files to server on save' but it doesn't do it.
    The only thing I can think of it that it has to be an actual live server? Nothing else can explain it. My setting are fine and like I said, doing it manually works no problem.
    I have the most recent version of DW CC
    Thanks,
    Jake

    Hi,
    I am developing a site locally and testing on a local host. I have my working files in Adobe cloud and then 'upload' to my local host to test.
    This works fine when I click upload, or control+shift+u, but its extremely annoying.
    I have checked the box that says 'automatically upload files to server on save' but it doesn't do it.
    The only thing I can think of it that it has to be an actual live server? Nothing else can explain it. My setting are fine and like I said, doing it manually works no problem.
    I have the most recent version of DW CC
    Thanks,
    Jake

  • Swf url links not working on local files

    Tearing my hair out on this one. I have simple swf files with
    links to html pages in the same directory - they work fine on the
    internet, but not when they're local. I'm on a mac osx 10.4.11
    FireFox and Safri. Flash pro cs3. I need the links to work on the
    web & CD. I've updated flash player ... etc...
    thanks in advance for any clues!
    Dave

    Hi Per,
    Wamp server's default site folder is www.  For best results, you should move your Local Site folder to www inside your wamp server.  That way, when you save changes locally they are automatically saved to your local testing server. 
    Click on screenshots below:
    Spaces in file and folder names are never a good idea because they get converted to %20 characters which can lead to path problems.
    Nancy O.

Maybe you are looking for

  • Transport control program tp ended with error code 0247

    Hi, Our landscape is such that any transport request once released, gets imported to Q system immediately. However there is another system (another box REG - regression testing) to which I would like to import a request but the transport queue of REG

  • Literal from value in setActionListener

    Hi, This one should be easy. I have two tables on a jpx in ADF Faces. Each row in each of the tables has a command link in one or more cells. I would like to use an action listener to determine which table the command link is contained in. The simple

  • Adobe creative suite 6 master collection not downloading

    I bought the program off of amazon, after attempting the download i was faced with an alert notifying me that my program wqas counterfeit and the download would not continue. So i then returned this program, thinking it was pirated, and bought a new

  • Flash Builder doesn't launch my app nor debugger

    Hi, very odd. Flash Builder all of a sudden stopped launching my app or the debugger. When I press run Flash Builder switches to my browser (Firefox 3.x) then nothing. Doesn't open a new tab, no error messages, nothing. Exact same thing when I try to

  • I purchased a song and can't get it to play on my iPhone5. Any help? Thanks :)

    I purchased a song from iTunes and it will not play on my iPhone5. It works fine in iTunes. Any help? Thanks!