Basic Java - On file name

if a java class is not a public class, we need not want to give its class name as file name. why ..... ? Kindly answer...

Not the right place to be asking that, I don't think.
theAmerican

Similar Messages

  • Abount java source file name

    Friends,
    I am new in java... Kindly clarify my doubt...
    when i create public class i have to give the class name as my file name. but if i create a default class
    like
    class SimpleClass
    i need not give the exact class name as file name.
    why?
    sorry for my english...

    Java source code files may contain one and only one top-level (that is, non-nested) public class declaration. The name of the public class must match the source file name.
    The java language specification details this here:
    http://java.sun.com/docs/books/jls/third_edition/html/packages.html#26783
    Obviously if you were permitted more than one top-level class per compilation unit then I suspect you would into problems with access privileges.

  • How to alter 'add to file names' script?

    I'm working on some stuff that I need to get done today, and it dawned on me that I could save a lot of time if I had a certain script perform a simple task for me. Unfortunately I haven't been able to get one to work right. I just want to be able to add the same thing onto the end of a file name... For instance, 01.jpg would become 01x.jpg, 02.jpg becomes 02x.jpg and so on. The basic 'Add to File Names' script will almost work, but it adds to the front of the name, not the back. Does anyone know how I could alter the lines in that script to get it to do what I want?
    Thanks for any help,
    Dave

    01. Under 'Alternative 01:', the line ...
    No error checking for folders is included. Such is an exercise for the student.
    ... should have been ...
    --No error checking for folders is included. Such is an exercise for the student.
    02. The error message ...
    "System Events got an Error: NSCannotCreateScriptCommandError".
    Hmmm, those replying are using MacOS X 10.4.x, and you are using MacOS X 10.2.x. Others, with Macs running MacOS X 10.2.x and using AppleScript code from MacOS X 10.3.x and later, do at times experience 'NSCannotCreateScriptCommandError' error messages.
    In the code below, 'System Events' was replaced with 'Finder'. Some additional editing was performed, where required.
    Alternative 01:
    property tAddition : "x" -- The charcter or string to append to the files' name.
    tell application "Finder"
    set tSelection to selection
    --No error checking for folders is included. Such is an exercise for the student.
    repeat with i in tSelection -- Cycle through the provided files.
    set {displayed_name, name_Extension} to {displayed name of (i as alias), name extension of (i as alias)}
    if ((displayed_name ends with name_Extension) and ((count name_Extension) > 0)) then
    -- Handle file names which include a name extension.
    set (name of i) to ((get (characters 1 through ((count displayed_name) - (count name_Extension) - 1) of displayed_name) as string) & tAddition & "." & name_Extension)
    else
    set (name of i) to (displayed_name & tAddition) -- Handle file names without a name extension.
    end if
    end repeat
    end tell
    Save the AppleScript code as a script.
    Move file (or a copy or alias of the file) to the '~/Library/Scripts/' folder.
    Select files to be processed, in 'Finder'.
    Select the script, via the 'Script menu'.
    Alternative 02:
    property tAddition : "x" -- The charcter or string to append to the files' name.
    on run {} -- User double-click on the applet.
    display dialog "Drag file(s) onto applet for processing."
    end run
    on open selected_Items -- User dragged items onto applet.
    my handleitems(selectedItems) -- Processed items dragged onto applet.
    end open
    on handleitems(localItems)
    -- No error checking for folders is included. Such is an exercise for the student.
    tell application "Finder"
    repeat with i in local_Items -- Cycle through the provided files.
    set {displayed_name, name_Extension} to {displayed name of i, name extension of i}
    if ((displayed_name ends with name_Extension) and ((count name_Extension) > 0)) then
    -- Handle file names which include a name extension.
    set (name of i) to ((get (characters 1 through ((count displayed_name) - (count name_Extension) - 1) of displayed_name) as string) & tAddition & "." & name_Extension)
    else
    set (name of i) to (displayed_name & tAddition) -- Handle file names without a name extension.
    end if
    end repeat
    end tell
    end handle_items
    Save the AppleScript code as an applet (application).
    Drag files to be processed, onto the applet, in 'Finder'.

  • How to specify relative path for file name in java class

    I have a directory structure like this.
    C:\Aurora\com\optemys\aurora\validation
    I have a class Test.java under the validation folder.
    I have various files under the same folder i.e validation.
    If I want to access the file "test.properties" in Test.java, how can I just specify "test.properties" & not "C:\Aurora\com\optemys\aurora\validation\test.properties".
    I dont want to hardcode any file path into the class. How can I specify the relative file name into the class.
    Thanks In Advance
    Sachin

    switch the name in Test.properties and use
    this.getClass().getResourceAsStream(fileName)

  • Java.io.File only returns similar file names

    I have written a bean which reads a directory and places the file names in an array, which can be accessed by a JSP page. At first, the files inside the directory were named wb_1.jsp, wb_2.jsp, wb_3.jsp and so on. When I change a filename to something like work.jsp, it still appears in the file list, but when I rename it to something like identify.jsp, it doesn't!
    If I count the array, it does read the correct number of files.
    Class FileHandler
    // Imports
    import java.io.File;
    // Class
    public class FileHandler
         // Constants and variables
         public File dir;
         public File[] files;
          * Returns the number of files found inside the given directory
         public int showFiles()
              try
                   setDir(getDir());     // Get file directory as set in the bean property
                   files = dir.listFiles();     // List the files found inside the directory
              catch (Exception e)
                   System.out.println(e + " : No files found to return a value");
              return files.length;      // Return the number of files
          * Returns the file name by using the in value in the files array
         public String returnFileName(int in)
              return files[in].getName();     // Return the name of the file
          * Sets dir file type to the setproperty value in
         public void setDir(File in)
              dir = in;     // Set class variable value for dir
          * Returns the dir value
         public File getDir()
              return dir;     // Return the setproperty value for dir
    }And the JSP code which reads the array
    out.println("<select onChange=\"jumpMenu('top',this,0)\" size=\"5\" style=\"width: 200\"");
    String fileName = new String();
    for(int x=0; x<file.showFiles(); x++)
         fileName = file.returnFileName(x);
         out.println("<option selected value=\"beheer.jsp?action=2&file=" +  fileName + "\">" +  fileName +"</option>");
    out.println("</select>");

    I forgot bean properties im the above code lines. Here it is, just in case.
    <jsp:useBean id="file" class="FileHandler" scope="page" />
    <jsp:setProperty name="file" property="dir" value="C:\\IBM Websphere workspace\\Project\\Web Content\\WEB-INF\\include" />

  • Dynamic FIle Name JAVA code

    Hi Guys,
    he requirement is to get File Name as XYZ.ddmmyyyy where as XYZ is constant.
    To achive this I am writing UDF in message mapping with dynamic configuaration below is the code:
    While I was trying to test end to end it is giving Runtime Exception in message mapping. please advice if this code needs correction?
    I have mapped as Source Main Node .....> UDF >  Target main node correct if it is wrong.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    DateFormat dateFormat = new SimpleDateFormat("ddMMyyyy");
    Date date = new Date();
    String  filename =  "XYZ" + dateFormat.format(date);
    conf.put (key,filename);
    return null;   
    Thanks.

    Hi ,
         Please try replacing this line
    DateFormat dateFormat = new SimpleDateFormat("ddMMyyyy");
    with this line
    java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat("ddMMyyyy");
    Hope this solves your problem.
    regards
    Anupam

  • Java.lang.NullPointerException: When Get the PDF File Name

    Hi,
    i try to follow the blog on <b>Handling FileUpload and FileDownload in NetWeaver Developer Studio(NWDS) 2004S</b> on /people/rekha.malavathu2/blog/2006/12/12/handling-fileupload-and-filedownload-in-netweaver-developer-studionwds-2004s
    as i create a fileupload and i wish to get the file name and the pdf, then i to run and deploy it but i get <b>java.lang.NullPointerException</b>
    the code are as below when i click on send email button
    IPrivateEmail.IFileUploadNodeNode node = wdContext.nodeFileUploadNode();
    IPrivateEmail.IFileUploadNodeElement fileUploadEle = node.createFileUploadNodeElement();
         try{
         IWDResource resource = WDResourceFactory.createResource(wdContext.currentContextElement().getFileUploadUI().read(true), wdContext.currentContextElement().getFileUploadUI().getResourceName(), WDWebResourceType.PDF, true);
         fileUploadEle.setFileUploadAttr(resource);
         fileUploadEle.setFileUploadName(wdContext.currentContextElement().getFileUploadUI().getResourceName());
         node.addElement(fileUploadEle);
         }catch(Exception e){
         wdComponentAPI.getMessageManager().reportSuccess("ERROR"+e.getMessage());
    but i wonder which part of the code i did wrongly.. as i wish to insert into my send email code
    Properties props = new Properties();
              String host = "SMTP HOST";
              props.put("mail.smtp.host", host);
              Session session = Session.getInstance(props, null);
              MimeMessage message = new MimeMessage(session);
              Address toAddress = new InternetAddress();
              Address fromAddress = new InternetAddress();
              Address ccAddress = new InternetAddress();
              Address bccAddress = new InternetAddress();
              try
                   MimeMultipart multipart = new MimeMultipart();
                   BodyPart messageBodyPart = new MimeBodyPart();
                   if (! wdContext.currentEmailElement().getFrom().equals(""))
                        fromAddress = new InternetAddress(wdContext.currentEmailElement().getFrom());               
                        message.setFrom(fromAddress);
                   if (! wdContext.currentEmailElement().getTo().equals(""))
                        toAddress = new InternetAddress(wdContext.currentEmailElement().getTo());
                        message.setRecipient(Message.RecipientType.TO, toAddress);
                   if (! wdContext.currentEmailElement().getCc().equals(""))
                        ccAddress = new InternetAddress(wdContext.currentEmailElement().getCc());
                        message.setRecipient(Message.RecipientType.CC, ccAddress);
                   if (! wdContext.currentEmailElement().getBcc().equals(""))
                        bccAddress = new InternetAddress(wdContext.currentEmailElement().getBcc());
                        message.setRecipient(Message.RecipientType.BCC, bccAddress);
                   if (! wdContext.currentEmailElement().getSubject().equals(""))
                        message.setSubject(wdContext.currentEmailElement().getSubject());
                   if (! wdContext.currentEmailElement().getBody().equals(""))
                        messageBodyPart.setText(wdContext.currentEmailElement().getBody());
                   multipart.addBodyPart(messageBodyPart);
                   messageBodyPart = new MimeBodyPart();
                   String filename = IWDResource.getResourceName();
                   DataSource source = new FileDataSource(filename);
                   messageBodyPart.setDataHandler(new DataHandler(source));
                   messageBodyPart.setFileName(source.getName());                    
                   messageBodyPart.setHeader("Content-Type","application/pdf");
                   multipart.addBodyPart(messageBodyPart);
                   message.setContent(multipart);
                   Transport.send(message);
              catch (AddressException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
              catch (SendFailedException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
              catch (MessagingException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
    so i wonder could anyone help me out.. as i need to get the pdf filename order to put into the variable call <b>filename</b> at the send mail code.
    below is the error message
    java.lang.NullPointerException
         at com.sap.example.uploademail.Email.wdDoInit(Email.java:124)
         at com.sap.example.uploademail.wdp.InternalEmail.wdDoInit(InternalEmail.java:146)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:183)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:178)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:748)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:283)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

    facing same issue.
    jdev 10.1.3.3.0, on expanding the database connection, I get a null pointer exception.
    On the testing the connection it says 'success' though.
    any inputs ?

  • Java.io.File and non-unicode characters in file name

    Unix filesystem object names are byte sequences. These byte sequences are not required to correspond to any character sequence in the current or any locale. How do I open a file if it has characters that do not corrospond to a valid unicode encoding for some current locale? Unless I am missing something, if I do a list on a parent directory that has some file names like this, those file names do not get added to the list. Hmmm....
    R.

    OK, create.c is a program that will create a file whose name is not a character in the 'ja' locale.
    Lister.java defines a class that lists files in the current directory. For each file, it spits out the 'toString()' version of the file, the char array of the name as hex, and the 'getBytes' byte array of the name.
    So, what you can do is compile and run create.c, which will create a file whose name is a single byte whose hex value is 99. Then compile and run Lister.java, which will give you the following output (shown for two different locales:
    $ export LANG=
    $ java Lister
    name:?; chars:99,; bytes:99,
    $ export LANG=ja
    $ java Lister
    name:?; chars:fffd,; bytes:3f,
    ---------------------------------------------Note that when running in the JA locale, there is no character corresponding to byte value 0x99. So, Java uses the replacement character 0xFFFD, and the '?' character 0x3F, as a replacement.
    The point is that there are files which Java cannot uniquely represent as a straight String. I suppose we could get the filename via JNI, do the conversion ourselves, and then use the private-use area of Unicode to encode all our strings, but ugh.
    //create.c
    #include <stdio.h>
    int main()
       const char* name = "\x99";
       FILE* file = fopen( name, "w" );
       if( file == NULL )
          printf( "could not open file %s\n", name );
          return 1;
       fclose( file );
       return 0;
    // Lister.java
    import java.io.*;
    public class Lister
        public static void main( String[] args )
            new Lister().run();
        public void run()
            try
                doRun();
            catch( Exception e )
                System.out.println( "Encountered exception: " + e );
        private void doRun() throws Exception
            File cwd = new File( "." );
            String[] children = cwd.list();
            for( int i = 0; i < children.length; ++i )
                printName( children[ i ] );
        private void printName( String s )
            System.out.print( "name:" );
            System.out.print( s );
            System.out.print( "; chars:" );
            printCharsAsHex( s );
            System.out.print( "; bytes:" );
            printBytesAsHex( s );
            System.out.println();
        private void printCharsAsHex( String s )
            for( int i = 0; i < s.length(); ++i )
                char ch = s.charAt( i );
                System.out.print( Integer.toHexString( ch ) + "," );
        private void printBytesAsHex( String s )
            byte[] bytes = s.getBytes();
            for( int i = 0; i < bytes.length; ++i )
                byte b = bytes[ i ];
                System.out.print( Integer.toHexString( unsignedExtension( b ) ) + "," );
        private int unsignedExtension( byte b )
            return (int)b & 0xFF;
    }

  • Why java file name and class name are equal

    could u explain why java file name and class name are equal in java

    The relevant section of the JLS (?7.6):
    When packages are stored in a file system (?7.2.1), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true:
    * The type is referred to by code in other compilation units of the package in which the type is declared.
    * The type is declared public (and therefore is potentially accessible from code in other packages).
    This restriction implies that there must be at most one such type per compilation unit. This restriction makes it easy for a compiler for the Java programming language or an implementation of the Java virtual machine to find a named class within a package; for example, the source code for a public type wet.sprocket.Toad would be found in a file Toad.java in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory.
    When packages are stored in a database (?7.2.2), the host system must not impose such restrictions. In practice, many programmers choose to put each class or interface type in its own compilation unit, whether or not it is public or is referred to by code in other compilation units.

  • Java mapping for Dynamic File name: stuctures?

    Hi,
    Scenario:  Sender AS2 adapter --> PI --> Receiver File (NFS) Adapter. Just a file pass through, no mapping
    Requirement: Want to have the receiver file name as C1.yymmdd.C2 where C1 and C2 are contants and yymmdd is current date.
    I was told in sdn forum that I have to write java mapping and provided the sample code also. However, I am not sure how and where to use that sample code. Could you please help on following questions:
    1) What is the source and target data type structures for mapping?
    2) Where do I develop java mapping? How do I import to PI?
    3) How do I get access to SAP Netweaver Developer Studio? Can I download it to my laptop? or if I dont have access, can I use any other tool to develop? ( NetBeans, Eclipse ??) and how?
    4) what are the files and libraries that we need to import to java mapping? (e.g.,  Import aii_map_api.jar library)
    5) How to generate .jar file?
    If someone has already developed java mapping (.jar file) ready to import into PI, please provide the same.
    Thanks in advance
    - Riya Patil

    Hi Sarvesh,
    Is this UDF work if I dont select ASMP on sender side? (We tested selecting ASMP on both sender & receiver file adapters, it works fine and it works without UDF also).
    In my requirement I have to use sender AS2 adpter, please confirm if I can use this UDF without selecting ASMP on sender side.
    I have done the following tests:
    Test-1) Select ASMP with 'File Name' on both sender and receiver file adapters without any mapping (UDF)
    It works great. No UDF or mapping required. It is just pass through of file having the receiver file name same as in sender channel.
    Test-2) Select ASMP with 'File Name', only on receiver file adapter without any mapping (UDF)
    It is obvious, it doesn't work. I am getting the following error:
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
    Test-3) Select ASMP with 'File Name', only on receiver file adapter with mapping (using DynamicConfiguratio UDF)
    We are getting the following error message in SXMB_MONI:
    Fatal Error: com.sap.engine.lib.xml.parser.Parser~
    <SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_Filename_: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
    Here is the code we have in UDF:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = "C1." + a + ".C2";
    conf.put(key, SourceFileName);
    return " ";
    So looks like UDF is not working and it is failing in mapping. If I could make it work, I think there is good chance that I can see DynamicConfiguration under SOAP Header, which what required for the error we see in out test-2.
    Can someone please help me to straighten this UDF and make it work.
    Thanks in advance.
    - Riya Patil

  • Path or file name "java" not found error

    I am getting the error, path or file name "java" not found, when I type in sqlj -version.
    I am using a NT server and I have added the CLASSPATH and path to it.
    Does anyone have any ideas.

    What version of SQLJ are you using? What do you see when you type
    java
    or
    java -version
    on the command line?

  • File Name in Java Map

    Hello,
    I want to add the time stamp in the file name in JAVA map.
    Actually we are directly writing the file on to the file system from Java map and also giving its output to other map.
    So we need when we write the file on the file system the file name should be ABC_timestamp.
    Can anyone help me how to do this in Java Map.
    Thanks and Regards
    Hemant

    Hi,
    >>>Actually we are directly writing the file on to the file system from Java map and also giving its output to other map.
    are you sure you want to do this?
    this is highly inadvisable as mappings do not support restarts and any error handling
    further more what if the mapping will crash but the file will be created?
    if you restart the mapping you will get a second file?
    I'd recomment not doing anything like that - maybe think about your scenario once more ?
    Regards,
    Michal Krawczyk

  • How to get File name in Java Callout

    Hi,
    We are receiving EDI files with random file names through SFTP listening channel. How can we get the file name in the java callout.
    ~Ismail M

    You can try to find it out under CalloutMessage.
    CalloutMessage.getParameters().getProperty("filename")
    Thanks,
    Kathar

  • Dynamic file name while using java mapping

    Hi All,
    i need help.
    I am using java mapping to convert xml file in zip file.
    Now i need to set output file name as SiteId_TimeStamp.zip.
    Site id is comping in xml file.
    How can i do this?
    I tried many thing but didnt get the solution..
    As their is no message mapping so I am unable to use ASMA.
    Please help.

    Did you check the wiki? You just need to add the code into you java mapping..
      Map mapParameters = (Map) transformationInput.getInputHeader().getAll();
       // a) Set Output File name
       mapParameters.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic",
                                                             StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
       DynamicConfiguration conf = (DynamicConfiguration) mapParameters.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
       DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
       //Depending on your requirement edit this logic. Here, NewDynamicName + CurrentDate will be output file name.
       DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
       conf.put(key, ("NewDynamicName_" + dateFormat.format(new Date())) + ".pdf");

  • Java file name

    Hi,
    In an application I have seen a file name which extends **.ejb* instead of **.java*
    How this works? even eclipse compiles it!.
    Even calling one EJB to another is just instantiating it and getting references. how is it possible?
    -thanks.

    You seem to have a really hard time believing it works, even when you've seen it works. Extensions in general are not some magical construct that instantly transform the information in a file from one thing to another, you know...
    The file could be called "something.jpg" and still contain Java code, not an image. I don't think any of Java specs say that Java source needs to be in files that have a .java extension. Compiled Java classes are a different matter, of course.

Maybe you are looking for

  • How to update a fact table when a dimension table is reloaded

    We have implemented BI Apps 796. Insertion into W_EMPLOYEE_D table which stores all the employee information had stopped one year back as some company security policy restricted the informatica worklfows to pick up the data. (PER_ALL_PEOPLE_F was a H

  • How to cancel a print job in progress

    I have a HP C5580.  When i was using Windows ME on my former PC, I could easily go to Printers, select the 5580,  hit documents in queue, and hit cancel , and the printer stopped. Got a new Compaq  PC with Windows 7, and I can't figure out how to can

  • How to handle (drag and drop) and Action Event in a JList?

    I am having many JList, On click of an element in JList I am loading a image in JSP. But If I try to drag and drop one image from one bucket to another bucket Iam not getting any problem, But I when I drag all the images from the target List to some

  • FOOTER IS NOT MOVING AS I ADJUST PAGE HEIGHT

    I MEAN THE FOOTER NOT MOVING CORRESPONDING TO A NEW CHANGE IN HEIGHT.IF I CHANGE THE HEIGHT THE FOOTER STILL STAYS IN MIDDLE.IT IS NOT MOVING AUTOMATICALLY AS I SAW IN THE TUTORIAL.PLEASE HELP.

  • Differences in hours between FBL3N and KSB1

    Hello, I am looking into an issue where the hours posted in FBL3N do not match what is showing up in KSB1.  Payroll postings include a number of hours, which can be negative or positive, along with a negative or positive dollar amount.  The postings