How to get file size and name from a directory in 1.1.8

Hello
I am trying to get a list of files and their sizes in
1.1.8.i am compelled to use this,since the version
our company use is 1.1.8. i could successfully
resolve this in 1.3. using listfiles option.
can anybody suggest me how
to work on this in 1.1.8
Thanks
Arjun

if everything else fails try:
File dir = //your directory
String file = //the name of a file
FileInputStream in = new FileInputStream(new File(dir, file));
System.out.println("Size of " + file + " (in bytes) is " + in.available());Cheers,
Binil

Similar Messages

  • How to get customer number and name from the SD document

    Hi All,
    Can you please let me know how to get Customer Number and Name from the SD Document?
    Thanks a lot....
    Anil

    Hi,
    It will be displayed in the SD (BIlling document) itself,  you clikc on the VF03. The customer name and number will also appear in the SO document also Tcode VA03
    regards,
    radhika
    Edited by: kolipara radhika on Jul 10, 2009 5:32 AM

  • How to get the Portal Page name from PLSQL?

    Can anyone tell me how to get the portal page name from my dynamic page using plsql?
    Apparently you can get the page id and work it out from there, but my calls to get the page id are not returning any values anyway.
    My code for attempting to get the page id is below.
    <oracle>
    declare
    v_pageid varchar2(30);
    begin
    v_pageid := wwpro_api_parameters.get_value('_pageid', '/pls/portal30');
    htp.print('Page is '|| v_pageid);
    end;
    </oracle>
    Ideally I'd actually just like to get the page name. Is there a straightforward way to do this?
    Thanks in advance!
    Sarah

    Few clarifications -
    1. wwpro_api_parameters cannot be used to get default portal
    page parameters such as '_pageid', '_dad', '_schema' etc.,
    2. Page information can be obtained through any components which
    are available in that particular page. For example, in case of
    dynamic page, we need to publish it as a portlet and add it to the
    page. This process creates necessary packages in the DB, but we
    will not have access to the portlet methods.
    So, I would prefer creating a simple DB provider & portlet and access
    page title from its show method as follows -
    //Declare local variable l_page_id, l_page_title as varchar2
    select page_id into l_page_id from wwpob_portlet_instance$ where
    portlet_id = p_portlet_record.portlet_id and
    provider_id = p_portlet_record.provider_id;
    select name into l_page_title from wwpob_page$ where id=l_page_id;
    More information on DB provider can be found at
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/articles/understanding.database.providers.html
    Secondly, usage of wwpro_api_parameters.get_value method is
    incorrect. This method expects two arguments -
    <ul>
    <li><b>p_name : </b> The name of the parameter to be returned.</li>
    <li><b>p_reference_path : </b> An unique identifier for a portlet instance on the current page.</li>
    </ul>
    p_reference_path would be something like 99_SNOOP_PORTLET_76535103 and not some type of path as its name suggests.
    The following code fragment fetches all parameters available
    for a portlet.
    Note : Copy this code into 'show' method of your portlet.
    //Declare l_names, l_values as owa.vc_arr
    * Retreive all of the names of parameters for this portlet
    l_names := wwpro_api_parameters.get_names(
    p_reference_path=>p_portlet_record.reference_path);
    * Retreive all of the values of parameters for this portlet
    l_values := wwpro_api_parameters.get_values(p_names=>l_names,
    p_reference_path=>p_portlet_record.reference_path);
    //Loop through these arrays to get parameter information
    htp.p('<center><table BORDER COLS=2 WIDTH="90%" >');
    htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
    htp.tableData(wwui_api_portlet.portlet_heading('Name',1));
    htp.tableData(wwui_api_portlet.portlet_heading('Value',1));
    htp.tableRowClose;
    if l_names.count = 0 then
    htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
    htp.p('<td COLSPAN="2">'
    ||wwui_api_portlet.portlet_text(
    'No portlet parameters were passed on the URL.',1)
    ||'</td>');
    htp.tableRowClose;
    else
    for i in 1..l_names.count loop
    htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
    htp.tableData(l_names(i));
    htp.tableData(l_values(i));
    htp.tableRowClose;
    end loop;
    end if;
    htp.p('</table></center>');
    Hope it helps...
    -aMJAD.

  • How to get the pull path name from a file upload window

    Hello everyone!
    I have encountered the following problem with the following JSP code:
    <form method="post" action="filename.jsp">
    Upload JAVA program:
    <input type=file size=20 name="fname" accept="java">
    <input type=submit value="go">
    </form>
    <%
    String s = "";
    if (request.getParameter("fname") != null)
    s = request.getParameter("fname")
    %>
    The value of s is alway the filename. However I want to get the full path in addition to the filename, so that I can read the file. Does anyone know how to get the pull name of the file?
    thanks a lot in advance,

    Dear Sir,
    thanks a lot for your reply. Please let me explain what I intended to do: I want to upload a file from the local machine and then read the content of the file. Therefore I need to the fullpath of the filename like /var/local/file.java instead of file.java. The latter is what I got.
    The problem I have with your code is that the function like "request.getServerScheme()" is not recognized. Maybe is it because I didn't install servelet package? I only installed javax package btw. Also my application runns on Tomcat server if this could give you some information. The error message I had is as follows:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 36 in the jsp file: /addExercise.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:133: cannot resolve symbol
    symbol : method getServerScheme ()
    location: interface javax.servlet.http.HttpServletRequest
    url = request.getServerScheme()
    ^
    An error occurred at line: 36 in the jsp file: /addExercise.jsp
    Generated servlet error:
    /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:136: cannot resolve symbol
    symbol : method getServerScheme ()
    location: interface javax.servlet.http.HttpServletRequest
    + ((("http".equals(request.getServerScheme()) && request.getServerPort() != 80)
    ^
    An error occurred at line: 36 in the jsp file: /addExercise.jsp
    Generated servlet error:
    /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:137: cannot resolve symbol
    symbol : method getServerScheme ()
    location: interface javax.servlet.http.HttpServletRequest
    ||("https".equals(request.getServerScheme()) && request.getServerPort() != 443))
    ^
    An error occurred at line: 36 in the jsp file: /addExercise.jsp
    Generated servlet error:
    /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:139: cannot resolve symbol
    symbol : method getServletConfig ()
    location: interface javax.servlet.http.HttpServletRequest
    + "/" + request.getServletConfig().getServletName()
    ^
    An error occurred at line: 36 in the jsp file: /addExercise.jsp
    Generated servlet error:
    /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:140: cannot resolve symbol
    symbol : variable path
    location: class org.apache.jsp.addExercise_jsp
    + "/" + path
    ^
    5 errors
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:128)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:413)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:555)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

  • How to get the actual font name from a font file?

    Hi
    I have only the font Path I have to get the font name from that path. Any idea how to get the actual font name?
    Thanks,

    I would ask you these questions:
    Why do you need to do this?  What are you ultimately trying to accomplish?
    Are you really asking about the InDesign SDK?
    Do you really need to get the "name" of a font from an arbitrary file?  Or do you want information about a font installed on the system?  If so, what OS?
    Do you need to be able to handle any font format?
    Which font "name" do you mean?
    What language do you want the name in?
    (1) It's not clear what you're trying to accomplish.  A bit more information about your ultimate goal would be helpful.
    (2) This question is not at all specific to the InDesign SDK.  Are you really trying to do something in the context of an InDesign plug-in?  If so, you probably want to look at IID_IFONTFAMILY and the IFontFamily::GetFamilyName function.
    (3) If you are asking more generally, Windows and Mac both have system API calls to get this information, although those tend to deal with installed system fonts, not with arbitrary font files per se.
    Also, you can parse the name table from a True Type or Open Type font without using any system APIs; as True Type and Open Type are well-documented standards.  I would start by reading these:
    The Naming Table
    Font Names Table
    (4) Although there are other standards, such as Type 1 (PostScript) fonts, and True Type Collection files and other formats, especially on Mac.
    (5) Also, when you start down this road, you will quickly realize that your seemingly simple question is actually ambiguous, and that the answer is kind of complicated, because a font can have many names (a family name, a full font name, a style name, a PostScript name, etc.).
    (6) And not only does a font have multiple names, it can have each of those names in multiple languages and encodings.
    Any clarification would make this a better question.

  • How to get my photos and music from my iphone to my hp laptop without having windowed on my laptop

    i just got anew hp laptop.  it does not have windows.  I want to be able to link my iphone with my laptop but don't know how.  want to be able to get my photos and music from my phone to my laptop and be able to load music on to my ipod. Is this possible to do

    I think there is still no APP or a way to copy music or videos from Iphone to PC. Pictures can be copied when you access the storage of the iphone from PC. Not sure if you are using other laptop before with itunes where you organize everything about your iphone. If you have, copy the Itunes folder from My Music folder and paste it on the new laptop you have, (you need to install Itunes first on your new laptop before doing this)

  • How to get the failover partner name from C++ client

    Hi All,
    I have configured the mirroring session for my application.
    I want to modify the connection string with failover partner name.
    Could any one please let me to know how to get the failover partner instance from C++ client dynamically.
    Thanks,
    Prasad.

    Are you looking for this?
    http://www.connectionstrings.com/sql-server-2012/
    http://stackoverflow.com/questions/25534972/auto-failover-multiple-connections-to-mirror-database-when-principal-goes-down

  • How to get required tags and name spaces in the output File?

    Hello,
    I am doing IDOC to File sceanrio and I am able to get the file but the problem is that I am unable to get the required tag names. Out put file is having  ns0 ns1 and so on..
    Eg:
    ns2:MaterialDefinitionProperty><ns2:MaterialDefinitionProperty><ns2:ID>CU_NET_WEIGHT</ns2:ID></ns2:MaterialDefinitionProperty><ns2:MaterialDefinitionProperty><ns2:ID>EAN_SKU</ns2:ID></ns2:MaterialDefinitionProperty><ns2:MaterialDefinitionProperty><ns2:ID>CUPerCase</ns2:ID>
    and so on..
    Source structure is IDOC
    Target structure is External Defination imported with references.
    How can I get the output file with the exact namespaces and tags as imported through External Definations.
    Thanks in Advace.

    HI! Rajeev,
    I have gone through this forum and we having 100% same to same requirement here in my project.
    We want this at the top of the Output Payload..
    <?xml version="1.0" encoding="UTF-8" ?>
    - <SyncMaterialDefinition xmlns="http://www.siemens.com/ad/mes/b2mt-1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bml="http://www.wbf.org/xml/b2mml-v02" xmlns:sit="http://www.siemens.com/ad/mes/b2mml-v02-SITExt-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oag="http://www.openapplications.org/oagis">
    - <oag:ApplicationArea>
    and also isome part of payload nstead of    ns0:  and ns1:
    we want it as below for some part of same output payload
    <oag:ApplicationArea>
    - <oag:Sender>
      <oag:LogicalId>SAP</oag:LogicalId>
      <oag:Component>PMConnector</oag:Component>
      <oag:ReferenceId />
      <oag:Confirmation>Always</oag:Confirmation>
      </oag:Sender>
      <oag:CreationDateTime>2009-06-14T22:23:29.42Z</oag:CreationDateTime>
    </bml:MaterialDefinitionProperty>
    - <bml:MaterialDefinitionProperty>
      <bml:ID>XXXXXXX</bml:ID>
    - <bml:Value>
      <bml:ValueString>0.0</bml:ValueString>
      <bml:DataType>string</bml:DataType>
      <bml:UnitOfMeasure>n/a</bml:UnitOfMeasure>
      <bml:Any />
      *</bml:*Value>
    Check the above code how we want but we are getting in normal way .
    Could you please review this and guide me in detailed way how to do in a step by step manner if possible by taking my above payload condition.
    Regards:
    Amar Srinivas Eli

  • How to extract the size and date from a given file

    Hi,
    I want to extract the size and date of a file (it can be either a video, audio or text file) that the user points to the location of. But I am not sure how. Does Java have an api that can do this? If not is there some other way of doing this? Can anyone help? Thanks in advance.

    Have a look at java.io.File, specifically
    public long lastModified()
    This format returned (I find) is nasty, so then use java.util.Date (or java.sql.Date, look the same on the surface to me) to format it.
    Cheers,
    Radish21

  • How to get my Music and videos from my Macbook pro to apple TV

    I have some music and videos from my macbook that i have added to itunes from CD's and DVDs. Whenever i try to play music or movies on my apple TV it says that there is no music in the library. Is this because the items were not bought on itunes and were added from my computer??

    If the music and video is compatible, it should play from Computers.
    The Mac and iTunes must be running, the media files must be accessible on an internal or attached external drive.
    I assume you have enabled Home Sharing.

  • How to get your pictures and contacts from one device to another

    hey guys I just bought an iphone 5s and I wanted to transfer all my photos and contacts from my old iphone which was a 4s to my 5s. when I tried to do it first time a message appeared on my computer and said that it couldn't transfer anything because the software on my iphone 4s was too old. I updated everything and I tried to restore the backup, but instead of restoring it from my most recent backup it restored it from a backup that happened about a year ago. So i need to know how to restore a backup from my iphone 4s and transfer it to my 5s

    The following has instructions for transferring to a new iPhone via either iCloud or iTunes: Transfer content from an iPhone, iPad, or iPod touch to a new device - Apple Support

  • HT1947 how to transfer files, photos, and videos from my PC to my iPhone4

    how to transfer photos and videos from myPC to my iPhone4

    http://www.apple.com/support/iphone/syncing/

  • How to get logged in user name from windows service c#

    i use the below code to get logged in user name.
    private string GetLoggedInUser()
    string userName = "";
    if (System.Security.Principal.WindowsIdentity.GetCurrent() != null)
    userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
    return userName;
    just do not understand why it is not giving a logged in user name rather it is return data in this format
    NT AUTHORITY\SYSTEM but i want to get user name.
    i try to run my service as Local Service and local system account but in every case i am getting this string
    NT AUTHORITY\SYSTEM instead of logged in user name.
    so please guide me what to change in code. thanks

    System is the account the service is running under.
    There can be none or many interactive users be logged in. What if none or multiple are logged in? Which one are you referring to then?
    Armin

  • How to get server hostname and port from web form

    Hi All,
    I need to find out server hostname and port number
    from 9i form.
    That is if the form was called via:
    http://myserver.com:1234/f90servlet?form=test,
    i would like to call some
    GET_XXX_PROPERTY(SERVER_HOSTNAME) that would return
    myserver.com
    and
    GET_XXX_PROPERTY(SERVER_PORT) that would return
    1234
    or alternatively
    GET_XXX_PROPERTY(SERVER_URL) that would return
    complete URL, so that i can parse it myself.
    Does anything like this exist? If not,would be
    possible to get that information from any Java
    function via java importer?
    BR,
    Robert
    BR,
    Robert

    Robert,
    I'd add the code as a Java Bean in Forms and get this information from the Forms request URL.
    Add the following bean to a Canvas and make it a size of 1x1 pixel so taht it appears hidden
    import java.applet.Applet;
    import java.net.URL;
    import oracle.forms.handler.IHandler;
    import oracle.forms.properties.ID;
    import oracle.forms.ui.VBean;
    public class FrmRequestInfo extends VBean
    public static final ID pGetPort = ID.registerProperty("GET_PORT");
    public static final ID pGetHost = ID.registerProperty("GET_HOST");
    public static final ID pGetProtocol = ID.registerProperty("GET_PROTOCOL");
    private String _host;
    private String _port;
    private String _protocol;
    private URL FormsURL;
    Applet m_applet;
    /*Forms settings*/
    IHandler m_handler;
    public FrmRequestInfo()
    public final void init (IHandler handler)
    super.init(handler);
    m_handler = handler;
    // get the forms applet handler
    m_applet = m_handler.getApplet();
    // initialize cookie domain to the same domain that runs Forms
    // Services
    FormsURL = m_applet.getDocumentBase();
    _host = FormsURL.getHost();
    _port = new Integer(FormsURL.getPort()).toString();
    _protocol = FormsURL.getProtocol();
    public Object getProperty(ID p0)
    if (p0 == pGetHost)
    return _host;
    else if (p0 == pGetPort)
    return _port;
    else if (p0 == pGetProtocol)
    return _protocol;
    else
    return super.getProperty(p0);
    To get the port number you call
    VarcharVariable_Port := get_custom_property('beanblock.beanname',1,'GET_PORT');
    for the hostname
    VarcharVariable_Host:= get_custom_property('beanblock.beanname',1,'GET_HOST');
    Frank
    Ps.: just wrote the bean on the fly, without testing - but I am positive that it works as similar functionality works for me in other beans.

  • How to get a virtual host name from application in Tomcat?

    Hi,
    Is it possible to obtain the context path and virtual host name at the application (.war file) initialization stage?
    I need to set up these info into my application config table.
    Thanks

    I think it is impossible. It seems the application has no access to the host configuration which it is running in.

Maybe you are looking for

  • How do i move my Ipod library from my old g4 to my new mac pro

    How do i move my Ipod library from my old g4 to my new mac pro

  • Opera's Appearance Magically Changed, Looks Ugly Now!

    This happened a few days ago. I spent a couple of days in Ion and when I logged out and went back to Xfce4 my Opera was... weird. o.o I won't describe what it looks like because I will link to a screenshot so you can see for yourself but here are som

  • How to create a Demand in RPA from Service Request?

    Hi All, Could you please explain me how to create Demands to be shown in RPA when Service Request's status is set to Released. I have done the below mentioned configurations so far. Marked the "Resource Planning Relevance" in zitem category (copy of

  • FM for get  internal text number

    hi to all        I have alll the data about wbs element , network activity , ... etc , by passing these how can we get nternal text number(TXTKY) . I want to update text of PS text. is there any functional modules . please let me know its urgernt . t

  • Startup Error - System Temperature (90D)

    I just updated by bios as well. Now my fan will not stop!!!! This is my first HP laptop and I am not happy. Will call support tomorrow. Seems like they tried to fix my 90D error by turning the fan on all the time?