Setting filename/filepath

How can I set a path without calling a JFileChooser? A program I'm working on needs to get a current listing of all the files in a folder that will never change, so I want to hardcode the path to save time. However, I can't figure out how to get the String pathname converted into a File for the methods I need. Any help?

The java.io.File class has a constructor which takes a String - the directory name.
How about this.
import java.io.File;
public class MyLister
  /** directory to list */
  private static final String DIR_NAME = "\\temp";
  /** list all files in the default directory */
  public File[] listFiles()
    File dir = new File (DIR_NAME);
    return (dir.listFiles());

Similar Messages

  • Set-AuthenticodeSignature -filePath from Pipeline

    Not sure if this is a Set-AuthenticodeSignature problem, or my use of the pipeline. So, I have 
    Get-ChildItem "$MLF\Resources\*" -include:*.ps1,*.psm1,*.vbs
    returning the correct singable subset of files in a folder. But when I try to pipe the results to Set-AuthenticodeSignature I get errors claiming -filePath is empty. I have tried both $_ and $_.FullPath.
    Get-ChildItem "$MLF\Resources\*" -include:*.ps1,*.psm1,*.vbs | Set-AuthenticodeSignature -filePath:$_ -certificate:$Cert[0] -force
    Now I can put the Get-ChildItem result in a variable and then foreach the variable. But as usual the pipeline approach seems to mess with my head. I presume I don't need a foreach in the pipeline, because the whole point is the pipeline will send items one
    at a time, correct? I have found some example code that creates a pipeline enabled function, and it's in the function that Set-AuthenticodeSignature is called. From what I can tell Set-AuthenticodeSignature is pipeline capable, and I expected to
    have issues with the variable for  -certificate that is reused. So, where am I going wrong? Or am I barking up an empty tree?

    Works fine for me.
    $cert=Get-ChildItem -Path cert:\CurrentUser\my -CodeSigningCert
    Get-ChildItem "$MLF\Resources\*" -include:*.ps1,*.psm1,*.vbs | Set-AuthenticodeSignature  -certificate $cert
    ¯\_(ツ)_/¯

  • Set filename of printed PDF via script

    Hi folks!
    I have a little problem with generating a PDF. First my Workflow:
    I have a InDesign document with 6 pages. This document is merged with a databasefile containing 100 records. After merging it, we have to generate a PDF file. This PDF file is opened within acrobat. Within the document, I'm searching for an ID each record has so I can split the document to 100 files (each with 6 pages) and name it by the ID I found.
    The script within Acrobat is finished and working. I thought, the InDesign script is finished ,too. But I was wrong -.-
    I merged the databasefile with the document and exported it as PDF. But after exporting, we noticed that the script within Acrobat isn't finding the adressheader where the ID is in. The script only noticed the text after that header. The result is, that Acrobat get's always "null" as ID
    If we print the PDF with our PDFprinter, the header could be read by our Acrobat script. I don't know why this is... But now I changed the script to print the files via our PDF printer. Unfortunately I can't set a name for my exported file - do you know if there is a possibility to print PDF's without prompting after each one and with a via script given name?
    Here you can see the old script for InDesign and right after it, the Acrobat sript. Maybe I made some mistake by generating my PDFexport and don't need to use the printer?
    INDESIGN SCRIPT:
      * prompts filebrowser and stores name and path of file in variable
    var sourceDocument = File.openDialog("Bitte Indesign-Dokument auswählen", "*.indd", false);
      * stores only prefix of filename for use as new filename
    var newName = sourceDocument.name.substr(0,  sourceDocument.name.length-5);
      * stores folder where file is stored
    var dbSourceFolder = sourceDocument.parent+"/";
      * prompts for databasefile where generating should begin
    var dbstartfile = File.openDialog("Bitte Start-Datenbankdatei auswählen", "*.txt", false);
      * gets basename of databasefile
    var dbstartfilename = dbstartfile.name.slice(0, dbstartfile.name.search(/_Teil+/));
      * gets number of first databasefile
    var i = dbstartfile.name.slice(dbstartfile.name.search(/_Teil+/)+5).slice(0, -4);
      * generates path name and name of first databasefile to use
    var dbSource = dbstartfile;
       *set PDF preset for generating PDF
    var PDFPreset= app.pdfExportPresets.item("GAG-PDF");
       * stops throwing of alerts
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    // if databasefile isn't existing message will be thrown
    if( dbSource.exists == false ) {
        // restart of alert throwing
        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
        alert("Datei " + dbSourceFolder+dbprefix+"_Teil"+i+".txt konnte nicht gefunden werden! \n\rBitte starten Sie den Vorgang erneut und geben Sie die richtige Datenbankdatei an." );
    // else process starts
    else {
        while(  dbSource.exists == true ) {
            // opens source indesign document without showing it
            mergeDocument = app.open(File(sourceDocument), false);
            // sets which databasefile should be used for data merge
            mergeDocument.dataMergeProperties.selectDataSource(File(dbSource));
            // starts merging of indesign document and database file
            mergeDocument.dataMergeProperties.mergeRecords();
            // exports generated document as PDF file
            app.activeDocument.exportFile(ExportFormat.pdfType, File(sourceDocument.parent+"/"+newName+"_Teil"+i+".pdf"), false, PDFPreset);
            // closes opened indesign document
            mergeDocument.close(SaveOptions.no);
            i++;
            // change filename of database file to get next file
            dbSource = File(dbSource.parent+"/"+dbstartfilename+"_Teil"+i+".txt");
    // restart of alert throwing
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    alert("PDF-Generierung abgeschlossen!");
    ACROBAT SCRIPT:
    * Path where files should be saved
    * Special Characters like spaces should be escaped with \
    * If you want to modify the folder, use following form:
    * "/Driveletter/Foldername/../LastFolderName/"
    * Make sure not to forget the / before and after the location
    var filepath = "/c/pdf_split_test/";
    * Number of expose pages - feel free to change
    var pageType = app.prompt("Bitte geben Sie die gewünschte Seitenzahl der Exposés an.", "");
    alert(pageType);
    * regular expression for search
    var idNumber = /08\d\d\d\d\-\d\d\d\-\d\d\d\d\d-\d\d\d-\d\d/g;
    * if possible this function extracts the searched number as string
    * @param rematch string which should be searched in document
    * @return null if rematch is not found or string if rematch is found
    function ExtractFromDocument(reMatch) {
      try {
             var Out = new Object();
             for (var i = 0; i < 1; i++)
              numWords = this.getPageNumWords(i);
              var PageText = "";
              for (var j = 0; j < 30;j++) {
                  var word = this.getPageNthWord(i,j,false);
                  PageText += word;
              var strMatches = PageText.match(reMatch);
              if (strMatches == null) continue;
          return strMatches;
      } catch(e)
          app.alert("Processing error: "+e)
    * tries to load given filename (extracted number)
    * @param filename string of file which should be checked
    * @param n number to iterate while checking for files
    * @return true if file exists or false if not
    function checkIfFileExists(filename, n) {
        var existingDoc = false;
        try {
            if( n == 0) {
                var checkDoc = app.openDoc(filepath+filename+"-000.pdf");
            } else {
                var checkDoc = app.openDoc(filepath+filename+"-000_"+n+".pdf");
            checkDoc.closeDoc();
            existingDoc = true;
        } catch (e) {
        if( existingDoc == true ) {
            n = n+1;
            n = checkIfFileExists(filename, n);
        return n;
    var pageAmount = this.numPages;
    for( i=0; i<pageAmount; i+pageType ) {
        var filename = ExtractFromDocument(idNumber);
        fileExistence = checkIfFileExists(filename, 0);
        if(fileExistence != 0) {
            this.extractPages({nEnd:(pageType-1), cPath : filepath+filename+"-000_"+fileExistence+".pdf"}); 
        } else {
            this.extractPages({nEnd:(pageType-1), cPath : filepath+filename+"-000.pdf"});
        this.deletePages({nStart:0, nEnd: pageType-1});

    Hi,
    I have a little problem with generating a PDF. First my Workflow:
    I have a InDesign document with 6 pages. This document is merged with a databasefile containing 100 records. After merging it, we have to generate a PDF file. This PDF file is opened within acrobat. Within the document, I'm searching for an ID each record has so I can split the document to 100 files (each with 6 pages) and name it by the ID I found.
    Why you don't export 6-page PDFs directly from InDesign?
    robin
    www.adobescripts.co.uk

  • Set filename for file download

    Hi
    i have a servlet that sends a file to the client to be downloaded. When the client requests the file the dowload dialogue pops asking if the user wants to download/open but the name of the file is always the servlet name were it originates. Is there any way to set the filename and extension in the servlet e.g ExampleResult1234.csv and send this to the client so that when the dialogue pops up it is set?
    Current Servlet Code:
    String output = "some data from database in csv format";
            response.setContentType("application/binary");
         response.getWriter().write(output);Thanks
    David

    It would be nice for the next person who needs help with this if you posted your solutions. :)

  • FTP Adapter setting filename at runtime not working

    Hi,
    I am facing an issue SOA 11.1.1.5 with FTP Adapter setting the filename at runtime. I have a process that reads a file from local server and puts it over to a remote FTP Server.
    I want to use the same filename that is picked up locally and placed on the ftp location. Below is the snippet of FTP Invoke and the filename is read from a variable which is set before the invoke
    <invoke name="Invoke_PutFile"
    inputVariable="Invoke_PutFile_PutFile_InputVariable"
    partnerLink="PutFile" portType="ns2:PutFile_ptt"
    operation="PutFile" bpelx:invokeAsDetail="no">
    <bpelx:inputProperty name="jca.file.TargetFileName" variable="targetFileName"/>
    </invoke>
    Here is the FTP jca file snippet
    <endpoint-interaction portType="PutFile_ptt" operation="PutFile">
    <interaction-spec className="oracle.tip.adapter.ftp.outbound.FTPInteractionSpec">
    <property name="LogicalDirectory" value="FtpDir"/>
    <property name="FileType" value="ascii"/>
    <property name="Append" value="false"/>
    <property name="TargetFileName" value="setAtRunTime"/>
    <property name="NumberMessages" value="1"/>
    </interaction-spec>
    </endpoint-interaction>
    But when I test I am getting an error, it's complaining Cannot set JCA WSDL Property. Error while setting JCA WSDL Property. Property setTargetFileName is not defined for oracle.tip.adapter.ftp.outbound.FTPInteractionSpec Please verify the spelling of the property. ".
      Fault Details : com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.oracle.com/bpel/extension}bindingFault} messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage} parts: {{ summary=Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'PutFile' failed due to: Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "Could not instantiate InteractionSpec oracle.tip.adapter.ftp.outbound.FTPInteractionSpec due to: Cannot set JCA WSDL Property.
    Error while setting JCA WSDL Property. Property setTargetFileName is not defined for oracle.tip.adapter.ftp.outbound.FTPInteractionSpec Please verify the spelling of the property. ".
    The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. ".
    The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. ,detail=Cannot set JCA WSDL Property.
    Error while setting JCA WSDL Property. Property setTargetFileName is not defined for oracle.tip.adapter.ftp.outbound.FTPInteractionSpec Please verify the spelling of the property. ,code=null}
      If I use *<property name="FileNamingConvention" value="%yyMMddHHmmssSS%_%SEQ%.txt"/>* inside the jca file it works but I want to use the filename at runtime and be the same name as it's picked up.
    Any idea what I am doing wrong.
    Thanks

    .bpel file
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
      Oracle JDeveloper BPEL Designer
      Created: Mon Jun 03 10:33:49 CDT 2013
      Author: 
      Type: BPEL 1.1 Process
      Purpose: Empty BPEL Process
    -->
    <process name="SharedServiceFtpFileMove"
                   targetNamespace="http://xmlns.oracle.com/SOALocal/SharedServiceFtpFileMove/SharedServiceFtpFileMove"
                   xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
                   xmlns:client="http://xmlns.oracle.com/SOALocal/SharedServiceFtpFileMove/SharedServiceFtpFileMove"
                   xmlns:ora="http://schemas.oracle.com/xpath/extension"
                   xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
             xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/SOALocal/SharedServiceFtpFileMove/FilePoller"
             xmlns:ns2="http://xmlns.oracle.com/pcbpel/adapter/ftp/SOALocal/SharedServiceFtpFileMove/PutFile"
             xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
             xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
             xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
             xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
             xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
             xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
             xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
             xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
             xmlns:ns5="http://xmlns.oracle.com/SharedServiceEmailNotification/xsd/V1"
             xmlns:ns4="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
             xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap">
      <!--
         ORCHESTRATION LOGIC                                              
         Set of activities coordinating the flow of messages across the   
         services integrated within this business process                 
      -->
      <partnerLinks>
        <partnerLink name="FilePoller" partnerLinkType="ns1:ReadFile_plt"
                     myRole="ReadFile_role"/>
        <partnerLink name="PutFile" partnerLinkType="ns2:PutFile_plt"
                     partnerRole="PutFile_role"/>
      </partnerLinks>
      <variables>
        <variable name="Receive_ReadFile_InputVariable"
                  messageType="ns1:ReadFile_msg"/>
        <variable name="sourceFileName" type="xsd:string"/>
        <variable name="targetFileName" type="xsd:string"/>
        <variable name="Invoke_PutFile_PutFile_InputVariable"
                  messageType="ns2:PutFile_msg"/>
        <variable name="FtpJndi" type="xsd:string"/>
      </variables>
      <faultHandlers>
        <catchAll>
          <sequence name="Sequence1">
            <terminate/>
          </sequence>
        </catchAll>
      </faultHandlers>
      <sequence name="main">
        <receive name="Receive" createInstance="yes"
                 variable="Receive_ReadFile_InputVariable"
                 partnerLink="FilePoller" portType="ns1:ReadFile_ptt"
                 operation="ReadFile">
          <bpelx:property name="jca.file.FileName" variable="sourceFileName"/>
        </receive>
        <assign name="Assign_Data">
          <copy>
            <from variable="sourceFileName"/>
            <to variable="targetFileName"/>
          </copy>
          <copy>
            <from expression="'eis/Ftp/FtpAdapter'"/>
            <to variable="FtpJndi"/>
          </copy>
        </assign>
        <assign name="Assign_Invoke">
          <copy>
            <from variable="Receive_ReadFile_InputVariable" part="opaque"/>
            <to variable="Invoke_PutFile_PutFile_InputVariable" part="opaque"/>
          </copy>
        </assign>
        <invoke name="Invoke_PutFile"
                inputVariable="Invoke_PutFile_PutFile_InputVariable"
                partnerLink="PutFile" portType="ns2:PutFile_ptt"
                operation="PutFile" bpelx:invokeAsDetail="no">
          <bpelx:inputProperty name="jca.ftp.TargetFileName" variable="targetFileName"/>
          <bpelx:inputProperty name="jca.jndi" variable="FtpJndi"/>
        </invoke>
      </sequence>
    </process>File Adapter Poller jca
    <adapter-config name="FilePoller" adapter="File Adapter" wsdlLocation="FilePoller.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/FileAdapter" UIincludeWildcard="*-*.txt"/>
      <endpoint-activation portType="ReadFile_ptt" operation="ReadFile">
        <activation-spec className="oracle.tip.adapter.file.inbound.FileActivationSpec">
          <property name="DeleteFile" value="true"/>
          <property name="LogicalArchiveDirectory" value="FtpLocalArchive"/>
          <property name="MinimumAge" value="0"/>
          <property name="Recursive" value="true"/>
          <property name="PollingFrequency" value="15"/>
          <property name="LogicalDirectory" value="FtpLocalFiles"/>
          <property name="IncludeFiles" value=".*-.*\.txt"/>
          <property name="UseHeaders" value="false"/>
        </activation-spec>
      </endpoint-activation>
    </adapter-config>Ftp Adapter put jca
    <adapter-config name="PutFile" adapter="FTP Adapter" wsdlLocation="PutFile.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/Ftp/FtpAdapter"/>
      <endpoint-interaction portType="PutFile_ptt" operation="PutFile">
        <interaction-spec className="oracle.tip.adapter.ftp.outbound.FTPInteractionSpec">
          <property name="LogicalDirectory" value="FtpDir"/>
          <property name="FileType" value="ascii"/>
          <property name="Append" value="false"/>
          <property name="TargetFileName" value="setAtRunTime"/>
          <property name="NumberMessages" value="1"/>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>Thanks

  • Setting filenames for images sequences via scripting

    Is there a good way to set the output filename for a sequence via scriping? When I explicitly set the filename and render location, the frame number is being appended to the end of the extension. (example: "filename.png002").

    Did a quick test.
    You can set name the way you want "Comp 1-[#].jpg" - I mean if you add [#] by hand, AE seems to respect that.
    So I guess you could check how many frames you are going to render and set appropriate amount of # signs in the file name.
    Looking at your example, seems that AE ads frame number after the extension. In case you want to control where AE puts those frame numbers, try this "filename-[#].png" - that should do the trick.

  • Setting Filename for Chunked Content

    I am using FrameMaker 9 to generate XHTML output from XML files using the DITA-FMx plugin. The XML was converted from unstructured files so each XML file contains several related topics. I'm generating from a bookmap that has a chapter element for each of the XML files. I've then set the chunk attribute for each chapter element to "by-topic". This produces the output I'm looking for where each topic in the chapter generates a separate HTML file. However, the names of the HTML files are all based on the id attributes, which were automatically generated and are not very meaningful for humans. For example, the file names are things like i37215.html and i45200,html. I'm wondering if there is a way to specify the filename (or a prefix) for these chunked files.
    If I have a chapter called "Preface" that has two topics within it. When generating, I'd like to produce the following files:
    preface.html
    preface1.html
    preface2.html
    A second choice would be to use the title of the topic. So for the same Preface chapter it would be something like:
    preface.html
    whatcanitdo.html
    howdoesitwork.html
    Is there a way to control the name of the file that is generated by chunking?

    You can use the @copy-to attribute on topicrefs to specify the output name, but that's in conjunction with adding a topicref for each nested topic and specifying the @chunk="to-content select-topic". I haven't messed around with chunking much so don't know if there are other ways to do this.
    <topicref navtitle = "Nested Topic One"
        href = "topics/nested_topics.dita#_a2fe8326-adf1-49e5-820b-e3ee1209a6f0"
        copy-to = "nested_topics-1.dita" type = "topic"
        chunk = "to-content select-topic"></topicref>
    Since this is really a DITA-OT question and not so much related to Frame or DITA-FMx, you would probably get better responses by posting to the dita-users Yahoo group.
    Cheers,
    ...scott

  • Set filename to metadata field

    I'm currently in the process of building a Final Cut Server workflow.
    One part in the workflow is to trancode an asset to MPEG2 for broadcast. We use conventional filenames, so if we trancode the file should get a given filename and title. In FCSRV I created a metadatafield called 'filename'.
    I already succesfully created a subscription which encodes the file to MPEG2 if a metadata field is set on 'true'. But now I want to add to that subscription that the filename and the asset's title are set to the specified metadatafield. Is this possible?

    Another update:
    I just tested it using the direct location to the file:
    Command: /bin/cp
    Parameters: /Volumes/Xsan/Media/test.mov /Users/accountname/Desktop
    And this command actually works.
    So there must be something wrong with the parameters I'm using
    So I tried the following:
    Parameters: [[File Name]] /Users/accountname/Desktop
    this results in a "no such file in directory" notice. On the other hand the [[File Name]] is replaced by the right filename.
    So I thought, I must get the location of the file to get I good copy action.
    I eventually got this working:
    Parameters: "/Volumes/Xsan/Media/[[File Name]]" /Users/accountname/Desktop
    The brackets are mandatory.
    But I think this could be made easier using also fields from Final Cut Server, like:
    "[[Local Directory]]/[[File Name]]" /Users/accountname/Desktop
    The [[local directory]] is the field in FCSrv where the device location is stored, but the parameter is not recognized by FCSRV. Is there another way to get the path where the file is stored?
    Next step I'm investigating now is to change the filename by a custom field in Final Cut Server.
    I'll keep you posted.
    Message was edited by: StefSOFT

  • Setting FileName without using Orchestration

    Hello All,
    I have a requirement where, the file name should be ABC_yyyyMMddHHmmss.So I am using, Message Assignment shape in the orchestration
    Message(FILE.ReceivedFileName) = "ABC_" + System.DateTime.Now.ToString("yyyyMMddHHmmss");
    Is there any way of doing without orchestration. I tried using the %datetime_bts2000% but that has YYYYMMDDhhmmsss, where sss means seconds and milliseconds. I dont need milliseconds in the filename. Thanks

    To Add to my above reply..
    ABC_%datetime%.xml macro will have output like ABC_2015-02-24T160045. But it doesn't choose your required format.
    Closer to yours as you use is %datetime_bts2000%. But if you don't need milliseconds you can't use macro. You need to achieve this is in custom pipeline where you construct the name of the output file in the format as you want. Following code achieves your
    requirement.
    public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
    //set friendly date string
    string dateString = DateTime.Now.ToString("yyyyMMddHHmmss");
    //write updated value back to context
    inmsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", "ABC_"+dateString);
    //return the message with modified context
    return inmsg;
    NOTE: It depends on frequency of the message. If you have more frequent messages, then I would have better combination to avoid file overwritten issue.
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Checking Checkboxes & setting filename

    Hi,
    I am fairly new in creating acrobat forms and scripting.
    And now I will create a form for a friend and would of course create as user friendly as possible.
    The Scenario is:
    I have a form which has totally 6 Checkboxes, 2 Textfields and 2 Buttons.
    Now i want to realise the following tasks:
    1.) If one of the Checkboxes 1 - 3 is selected, the other two are automaticly unchecked. Also, if Checkbox 3 is selected the Textfield 1 is required. The same should be with the Checkboxes 4 - 6 and Textfield 2.
    2.) If the Textfield 1 is required it should be checked if the something is entered and the length is 6, 8 or 10.
    3.) It should be not possible to overwrite the original file. The user should be prompted to save a copy when he clicks the save button at the toolbar or the button at the form. Also the filename should be suggested based on which checkboxes are selected.
    In example: "Copy_ChkBx2_ChkBx4.pdf"
    4.) I want also add an button to let the user directly the pdf via email. The filename whould be generated like in at 3.). I want also to add some text to the email and set the subject to the filename.
    I don't know if all that is possible but it would be great when it is possible that somebody would show me how it is possible.
    Many thanks for your help.

    No, the hidden field is in a while loop, so value="<%= moduleBean.getModuleId() %>" is always different.
    This <td> tag
    <td><input type="hidden" name="checkbox" value="<%= moduleBean.getModuleId() %>"><input type="checkbox" name="checkbox1" value="<%= moduleBean.getModuleId() %>"></td>
    is in the while loop.
    Does it matter that the hidden field name, checkbox, is different from the checkbox name, checkbox1, that the user sees?

  • How to set filename into log4j.properties using LogFactory from apache

    I'm getting a java.lang.ClassCastException .. Please help. Thanks.
    package src;
    import java.io.IOException;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.apache.log4j.Category;
    import org.apache.log4j.rolling.RollingFileAppender;
    public class FileLock {
    private static Log log = LogFactory.getLog(FileLock.class);
         public static void main(String[] args) throws IOException {
              // TODO Auto-generated method stub
              String logFile="C:/TEST123.TXT";
              RollingFileAppender apd = (RollingFileAppender) ((Category) log).getAppender("FILELOG");
              apd.setFile(logFile);
              apd.activateOptions();
              log.debug ( "This is a test debug");
              log.trace ( "This is a test trace");
              log.fatal ( "This is a test fatal");
    Snapshot from my log4j.xml.
    <appender name="FILELOG" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="C:/a.log" />
    <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern"
    value="[%d{ISO8601}] %-5p %c %m %n" />
    </layout>
    <filter class="org.apache.log4j.varia.LevelRangeFilter">
    <param name="LevelMin" value="DEBUG"/>
    <param name="LevelMax" value="INFO"/>
    </filter>
    </appender>
    *************

    Thanks here's the list:
    log4j:INFO Using URL [file:/C:/TEST2/FileLocking/bin/log4j.xml] for automatic log4j configuration of repository named [default].
    [2006-08-10 10:52:08,421] DEBUG org.apache.log4j.joran.action.ConfigurationAction Ignoring debug attribute.
    [2006-08-10 10:52:08,437] DEBUG org.apache.log4j.joran.action.AppenderAction About to instantiate appender of type [org.apache.log4j.FileAppender]
    [2006-08-10 10:52:08,453] DEBUG org.apache.log4j.joran.action.AppenderAction Appender named as [FILELOG]
    [2006-08-10 10:52:08,453] DEBUG org.apache.log4j.joran.action.AppenderAction Pushing appender on to the object stack.
    [2006-08-10 10:52:08,453] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [File] to value [C:/a.log].
    [2006-08-10 10:52:08,484] DEBUG org.apache.log4j.joran.action.LayoutAction About to instantiate layout of type [org.apache.log4j.PatternLayout]
    [2006-08-10 10:52:08,531] DEBUG org.apache.log4j.joran.action.LayoutAction Pushing layout on top of the object stack.
    [2006-08-10 10:52:08,531] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [ConversionPattern] to value [[%d{ISO8601}] %-5p %c %m %n].
    [2006-08-10 10:52:08,593] DEBUG org.apache.log4j.joran.action.LayoutAction Popping layout from the object stack
    [2006-08-10 10:52:08,593] DEBUG org.apache.log4j.joran.action.LayoutAction About to set the layout of the containing appender.
    [2006-08-10 10:52:08,593] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMin] to value [DEBUG].
    [2006-08-10 10:52:08,593] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMax] to value [INFO].
    [2006-08-10 10:52:08,593] DEBUG org.apache.log4j.FileAppender setFile called: C:/a.log, true
    [2006-08-10 10:52:08,609] DEBUG org.apache.log4j.FileAppender setFile ended
    [2006-08-10 10:52:08,609] DEBUG org.apache.log4j.joran.action.AppenderAction Popping appender named [FILELOG] from the object stack
    [2006-08-10 10:52:08,609] DEBUG org.apache.log4j.joran.action.AppenderAction About to instantiate appender of type [org.apache.log4j.ConsoleAppender]
    [2006-08-10 10:52:08,609] DEBUG org.apache.log4j.joran.action.AppenderAction Appender named as [STDOUT]
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction Pushing appender on to the object stack.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [Target] to value [System.out].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction About to instantiate layout of type [org.apache.log4j.PatternLayout]
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction Pushing layout on top of the object stack.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [ConversionPattern] to value [[%d{ISO8601}] %-5p %c %m %n].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction Popping layout from the object stack
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction About to set the layout of the containing appender.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMin] to value [DEBUG].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMax] to value [INFO].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction Popping appender named [STDOUT] from the object stack
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction About to instantiate appender of type [org.apache.log4j.ConsoleAppender]
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction Appender named as [STDERR]
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction Pushing appender on to the object stack.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [Target] to value [System.err].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction About to instantiate layout of type [org.apache.log4j.PatternLayout]
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction Pushing layout on top of the object stack.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [ConversionPattern] to value [[%d{ISO8601}] %-5p %c %m %n].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction Popping layout from the object stack
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction About to set the layout of the containing appender.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMin] to value [WARN].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMax] to value [FATAL].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction Popping appender named [STDERR] from the object stack
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction About to instantiate appender of type [org.apache.log4j.net.SMTPAppender]
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.AppenderAction Appender named as [EMAIL]
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.AppenderAction Pushing appender on to the object stack.
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [BufferSize] to value [512].
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [SMTPHost] to value [exchange.medi.com].
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [From] to value [[email protected]].
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [To] to value [[email protected]].
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [Subject] to value [[SMTPAppender] Application message].
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.LayoutAction About to instantiate layout of type [org.apache.log4j.PatternLayout]
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.LayoutAction Pushing layout on top of the object stack.
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [ConversionPattern] to value [[%d{ISO8601}]%n%n%-5p%n%n%c%n%n%m%n%n].
    [2006-08-10 10:52:08,750] DEBUG org.apache.log4j.joran.action.LayoutAction Popping layout from the object stack
    [2006-08-10 10:52:08,750] DEBUG org.apache.log4j.joran.action.LayoutAction About to set the layout of the containing appender.
    [2006-08-10 10:52:08,750] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMin] to value [ERROR].
    [2006-08-10 10:52:08,750] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMax] to value [FATAL].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.AppenderAction Popping appender named [EMAIL] from the object stack
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.RootLoggerAction Pushing root logger on stack
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.LevelAction Encapsulating logger name is [root], levelvalue is [all].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.LevelAction root level set to ALL
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.AppenderRefAction Attaching appender named [FILELOG] to logger named [root].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.AppenderRefAction Attaching appender named [STDOUT] to logger named [root].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.AppenderRefAction Attaching appender named [STDERR] to logger named [root].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.AppenderRefAction Attaching appender named [EMAIL] to logger named [root].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.RootLoggerAction Removing root logger from top of stack.
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.JoranConfigurator Finished parsing.
    java.lang.ClassCastException
         at src.FileLock.main(FileLock.java:19)
    Exception in thread "main"

  • Set filename = wwv_flow_file_mgr.get_file

    Hi all,
    I would like to upload a unique file from Shared components > Static Files[br]
    So i use the following syntax :
    [a href='#WORKSPACE_IMAGES#file.txt']file.txt[a]
    The package wwv_flow_file_mgr calls the procedure get_file via :
    wwv_flow_file_mgr.get_file?p_security_group_id=#NUMBER#&p_fname=file.txt
    When i download the file, the confirmation window proposes the default filename as 'wwv_flow_file_mgr.get_file' but not 'file.txt'
    Can anyone explain me why?
    Is there a workaround to solve it?
    Regards,
    Grégory
    Message was edited by:
    mercierg
    Message was edited by:
    mercierg
    Message was edited by:
    mercierg

    Hi,
    I've noticed that as well.
    The only thing I could suggest would be to create your own download procedure. Follow the advice in for downloading files:
    http://download-uk.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm#CJAHDJDA
    Look for the download_my_file procedure. Edit this to get the files from APEX_APPLICATION_FILES instead of a custom table. You also need to ensure that you also grant rights to the procedure:
    GRANT EXECUTE ON download_my_file TO PUBLIC
    Regards
    Andy

  • Setting filename sending output to Excel form servlet

    Hi All
    I am successfully sending my tab separated output to Excel from the servlet using the following:
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","inline;filename=statistics.txt");
    The output is automatically opened in a new window using excel.
    However the sheet in excel is named based on the url of the servlet it came from, not statistics as i have specified. The main issue with this, apart from the niceness of it, is that if the user then generates another excel output from the same servlet then the new file is not loaded as excel already has a file by that name open and can't handle duplicate names.
    I have seen many references to this syntax, but it doesn't quite work for me.
    I hope someone can clarify what i am missing here.
    Thanks in advance.

    import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    import org.apache.poi.hssf.usermodel.HSSFSheet;
    import org.apache.poi.hssf.usermodel.HSSFRow;
    import org.apache.poi.hssf.usermodel.HSSFCell;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    import java.io.IOException;
    * @author Ravi Desu (rdesu)
    * @version 1.0
    * $Id: ExcelGen.java, Jun 1, 2004 4:43:13 PM rdesu Exp $
    public class ExcelGen extends HttpServlet {
    protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
    HSSFWorkbook workbook = new HSSFWorkbook();
    HSSFSheet sheet = workbook.createSheet("Worksheet 1");
    HSSFRow row = sheet.createRow((short) 0);
    HSSFCell cell = row.createCell((short) 0);
    cell.setCellValue("This is text in a cell");
    httpServletResponse.setContentType("application/vnd.ms-excel");
    workbook.write(httpServletResponse.getOutputStream());
    In your web.xml:
    <servlet>
    <servlet-name>ExcelGenSrvlt</servlet-name>
    <servlet-class>ExcelGen</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ExcelGenSrvlt</servlet-name>
    <url-pattern>/ExcelGen.xls</url-pattern>
    </servlet-mapping>
    download the org.apache.poi jars from
    http://www.apache.org/dyn/closer.cgi/jakarta/poi/
    http://jakarta.apache.org/poi/

  • Setting filenames at OS level on Win32

    I've done this many times on Unix using the .profile file. But today I need to do it on windows. I went to environment variables and entered
    New Variable = DATAFILE1
    Value = c:\data1.txt;
    New Variable = DATAFILE2
    Value = c:\data2.txt;
    Then in my code
    //Simple program that copies from one file to another
    public class demo {
        public static void main(String[] args) throws IOException {
         //This works
         File inputFile = new File("c:\\data1.txt");
         File outputFile = new File("c:\\data2.txt");
         //DATAFILE1,DATAFILE2 Set in control panel to reference files above.
         //compiler: cannot find symbols DATAFILE1, DATAFILE2
         //File inputFile = new File(DATAFILE1);
         //File outputFile = new File(DATAFILE2);
            FileReader in = new FileReader(inputFile);
            FileWriter out = new FileWriter(outputFile);
            int c;
            while ((c = in.read()) != -1)
               out.write(c);
            in.close();
            out.close();
    }Any ideas?

    Can you try "java -version" at the console, as it looks like you are not.
    Look, not depricated: System.getenv(java.lang.String)
    Also
    // throws NullPointerException
    String str = System.getenv("DATAFILE");Does that return null, or throw a NPE? As throwing an NPE would suggest that you are passing null to it, returning null would suggest DATAFILE is dot defined, try
    echo %DATAFILE%
    or
    echo $DATAFILEdepending on platform.

  • Rwservlet: set filename before sendind to printer

    Hi,
    I'd like to know if there is some way to change the filename of the PDF before sending it to printer.
    I'm using rwservlet with parameters: DESTYPE=printer DESFORMAT=pdf and DESNAME=dummy
    And when I check in my print server the file printed was: DUMMY0TBysKfm.pdf
    For tracing matters it's importante to know which report generated that printout.
    Can you help me, please?
    Best regards,
    Bruno.

    Hi,
    I have a little problem with generating a PDF. First my Workflow:
    I have a InDesign document with 6 pages. This document is merged with a databasefile containing 100 records. After merging it, we have to generate a PDF file. This PDF file is opened within acrobat. Within the document, I'm searching for an ID each record has so I can split the document to 100 files (each with 6 pages) and name it by the ID I found.
    Why you don't export 6-page PDFs directly from InDesign?
    robin
    www.adobescripts.co.uk

Maybe you are looking for

  • How to convert a measure value to null when the actual measure value is 0

    Hello Gurus, I have year, products, measure 1, measure 2, measure 3. I am added three products into one category by using bin in the analysis i am getting zeros for some of the measure cells when it should be null values, because the actual measure v

  • Build problem with makepkg of linux in the abs(core/linux)

    Hi,all I wanted to have a taste of systemtap, I read this page:https://wiki.archlinux.org/index.php/Systemtap,and followed the guide,but had problem like this: scripts/link-vmlinux.sh: line 135: ./.config: No such file or directory It looks like the

  • Issues with shell script

    Hi, I am executing on procedure using the shell script. The Shell script would the spool the output of the procedure into Status.txt file and send the condents through the mail. I am getting correct output when i run the job manually. But it is not g

  • Clean install of OXS - hard drive + extra internal

    I'm getting ready to do a clean install on my harddrive but I'm wondering how (if at all) it will impact my 2nd internal drive...? Hopefully not at all...?? Please help! Thanks Carrie

  • Locked Mac with Find My iPhone app

    So I used the "find my iPhone app" to lock my MacBook Air and it says the code is incorrect that I entered on the app. I am 100% sure of the code I typed in but it isn't working. How can I fix this?