How to find Capacity of  a directory

can anyone help me regarding this

This should do it,
// recursive
     public static long getFileOrFolderSize(File file) {
          long size = 0;
          if(file.isDirectory()) {
               File[] files = file.listFiles();
               if(files == null) {
                    size = (long)-1;
               } else {
                    for(int i = 0; i < files.length; i++) {
                         long tmp = getFileOrFolderSize(files);
                         size += (tmp == -1 ? 0 : tmp);
          } else {
               size += file.length();
          return size;
Jim

Similar Messages

  • How to find the oracle home directory of a particular database ?

    Hi all,
    There are multiple databases in our machine server ; there are many oracle9i and many oracle10g databases.
    I forgot the directory where I installed a particular database so I want to know how to know the directory path where its oracle_home was. For example C:\Orant\Bin.
    Thank you very much indeed

    Yea friend .
    I m agree with u . Because In my Linux server There are 2 database . I have to use Automatic run script (use dbstart) for Database so that Datbase will be auto up during startup. My default oracle Home for Oracle user is "/ORACLE" and also mention it i Oracle ".bash_profile" .
    I give the entry into "/etc/oratab " Like following :
    vi /etc/oratab
    test1::/oracle:Y
    test2::/oracle:Y
    But One database (test1) is up during startup the server but another (test2) is not . I dont understand the problem .... can anybody give me some suggestion ?
    In this pint , If Oracle Home is the problem then How can I find the Oracle Home regarding these two databases ?

  • How to find Capacity changes ( Who did)

    Hi Gurus,
    here is my question.....We have reference capacity scenarios...i.e when ever we create a work center ,in the capacity view we refer a reference capacity..so only changes can be done at reference capacity level...recently someone accidentally changed a week as non working week by going into  "intervals and shifts" tab (Putting value 0 in Workday column)......but who did it i could not find ...it is not recoreded anywhere......i have tried with KAPA ,KAZY  and  CR10 as well but without success...could anybody plz tell where can i find this information as to find who did this?.....Any help is highly appreciated...
    Thanks
    Appa

    Hi
    Check with T code AUT10 and give the T code and execute.
    Regards
    Anupam Sharma

  • How to find out if a directory exists

    I have a directory path as an input parameter to my stored procedure. I would like to validate the path. i have seen several examples using xp_fileexist. Are there any gotchas when using this? It sounds like it will not work for unc paths (\\asdfasdf\asfas).
    But does a security setting need to be turned on? is there another way to validate a path?

    SSIS is better fit than T-SQL for directory related tasks.
    If xp_cmdshell active, you can use DOS commands:
    http://www.sqlusa.com/bestpractices2005/filesindirectory/
    You can also use PowerShell:
    http://technet.microsoft.com/en-us/library/dd315304.aspx
    Security considerations:
    http://stackoverflow.com/questions/11740000/check-for-file-exists-or-not-in-sql-server
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to find from the data dict if a user has read access on a directory

    How to find "dynamically" if a user has READ access to a directory object.
    I want to know if there is a data dictionary table that holds if a user/schema has read access to a directory object.
    I know there is an dba_directories table and an all_directories table but they dont give information as to which user has read access granted to the directory.

    Not so difficult.
    select  'YES'
       from all_tab_privs A, all_directories B
       where a.grantee = 'USERNAME'
           and a.table_name = b.directory_name
           and b.directory_path = 'PATH YOU ARE LOOKING FOR'
    How to find "dynamically" if a user has READ access to a directory object.
    I want to know if there is a data dictionary table that holds if a user/schema has read access to a directory object.
    I know there is an dba_directories table and an all_directories table but they dont give information as to which user has read access granted to the directory.

  • How To Find Oracle Home Directory Path...

    Hello,
    I am working on deployment of java web service on Oracle Application Server(LINUX) 10g, EBS - R12.
    I am working on other system and i want to deploy web service remotely on application server.
    And i am not getting the oracle home directory path. I want to find the home directory path remotely.
    so suggest me how to find out path of that.
    or weather i have to install jdevloper on server system and than i have to deploy it,
    or any other alternative way is available.
    Reply as soon as possible......

    Thanks for your reply.
    It's precisely the registry key which got tampered, and there's no ORACLE_HOME environmental variable(Or that too is tampered)
    Now,how to set it to one of the Oracle home directories?
    Regards,
    Bhagat
    !!!!!!!!!!!!!!!!!!!!

  • How to find /i/ directory in apex 4.1

    Hello everyone,
    We are using Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 and Apex 4.1 and Apex Standalone listner,
    How to find /i/ directory in database.
    Thank you.

    Check http.conf to see the alias for /i/
    Try logging into APEX Listener admin
    http://docs.oracle.com/cd/E21611_01/doc.11/e21058/config.htm

  • How to find files and subdirectories in a directory

    can anyone tell me how to find files and subdirectories in a directory .

    Here's a code snippet,
    http://javaalmanac.com/egs/java.io/TraverseTree.html

  • Don't understand how to find my host directory

    hello
    i am not understanding how to find my host directory when
    trying to connect from Dreamweaver MX2004 to my webspace,using the
    remote info page on the site definition window.
    Is the host directory on the server of the web space
    provider?
    And how do i know what the folder it is or how to find it?
    thanks in advance
    Jason King

    > Is the host directory on the server of the web space
    provider?
    > And how do i know what the folder it is or how to find
    it?
    Yes.
    > And how do i know what the folder it is or how to find
    it?
    Ask the host what the root directory of the website is named.
    It could be
    www, or public_html, or anything else. That would be what
    goes in the host
    directory field.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "georgealmighty" <[email protected]> wrote
    in message
    news:etri9l$dqq$[email protected]..
    > hello
    > i am not understanding how to find my host directory
    when trying to
    > connect
    > from Dreamweaver MX2004 to my webspace,using the remote
    info page on the
    > site
    > definition window.
    >
    > Is the host directory on the server of the web space
    provider?
    > And how do i know what the folder it is or how to find
    it?
    >
    > thanks in advance
    > Jason King
    >

  • How to find the SQL Server Instances running across the given activer directory domain?

    How to find the SQL Server Instances running across the given activer directory domain?
    I have though of OSQL -L , Microsoft Assessment and Planning ( MAP ) tool and SQLPing3 (SQLSecurity) might help me.
    I would appreciate if there any other way of finding the SQL Servers / Instances running across the given active directory domain.
    Sivaprasad S
    http://sivasql.blogspot.com
    Please click the Mark as Answer button if a post solves your problem!

    Dear ,
    Very simple u find all instances through the customized sp which is get all details about inventory. Like i put the sp bellow. This is without any tool. 
    USE [master]
    GO
    /****** Object:  StoredProcedure [dbo].[DBStatus]    Script Date: 08-01-2015 19:46:11 By Damodar Patle Sr. DBA Mumbai India ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[DBStatus] 
    AS
    SELECT 
    SERVERPROPERTY('servername') AS ServerName,
    ConnectionProperty('local_net_address') AS 'local_net_address',
    ConnectionProperty('local_tcp_port') AS 'local_tcp_port',
    CONVERT(VARCHAR(25), @@VERSION) as  VERSIONSQL,
    SERVERPROPERTY('ErrorLogFileName') AS ErrorLogFilePath,
    database_id,
    CONVERT(VARCHAR(25), DB.name) AS DBName,
    CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'status')) AS [Status],
    CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'Recovery')) AS [Recovery_Model],
    create_date as DBCreate_Date, --physical_device_name,
     (SELECT COUNT(1) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS DataFiles,
     (SELECT SUM((size*8)/1024) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS [Data MB],
     (SELECT COUNT(1) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS LogFiles,
     (SELECT SUM((size*8)/1024) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS [Log MB],
     (SELECT physical_name FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS MDF_File_Location,
     (SELECT physical_name FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS  LDF_File_Location,
       user_access_desc
       FROM sys.databases DB
       ORDER BY dbName, [Log MB] DESC, NAME

  • How to find out one directory in unix

    How to find out one directory(Ex-abc dirctory) in linux??
    I am in home i dont know the location of that directory can give me some command to find the path of the directory ??
    I am new in linux ??
    Thanks advancly

    You may want to consider using wildcard and "-iname" which is case insensitive.
    find / -iname *ex-abc* -type dTo find files and directories you can also use the locate command, which uses a database to find stuff, after indexing the system, and hence is faster than a regular find:
    locate -i ex-abc... provided the database has been created and is up2date.
    sudo updatedbPls see "man locate" and "man find" for more options
    Edited by: Dude on Dec 1, 2011 6:24 AM

  • How to find out (directory service) hostname? (at networking) URGENT!!

    how to find out what (directory service) hostname is? (at networking) URGENT!!
    I'm installing Oracle 9.2.0.1.0 and can't figure out this one? please help asap!

    Hi,
    I'm installing Oracle 9.2.0.1.0 and can't figure out this one?During install, haven't you give the ORACLE_HOME ?
    Don't very well understand, can you more explain ?
    Nicolas.

  • How to find the patch & version of directory server

    How to find version & patch of Sun JES Directory Server.
    What does 2005Q4 mean to?

    Just look at your errors log file after you start up the directory server. If you are running Directory Server 6.0 you will find a line that looks like this:
    Sun-Java(tm)-System-Directory/6.0 B2007.030.1546 (32-bit) starting up
    Depending on the version you have it will show something slightly differently.

  • How to find out the user-exits?

    hi.
    how to find out the user-exits?
    regards
    eswar.

    Hi,
    *& Report  ZEXITFINDER
    *report  zexitfinder.
    *& Enter the transaction code that you want to search through in order
    *& to find which Standard SAP User Exits exists.
    *& Tables
    tables : tstc, "SAP Transaction Codes
    tadir, "Directory of Repository Objects
    modsapt, "SAP Enhancements - Short Texts
    modact, "Modifications
    trdir, "System table TRDIR
    tfdir, "Function Module
    enlfdir, "Additional Attributes for Function Modules
    tstct. "Transaction Code Texts
    *& Variables
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    *& Selection Screen Parameters
    selection-screen begin of block a01 with frame title text-001.
    selection-screen skip.
    parameters : p_tcode like tstc-tcode obligatory.
    selection-screen skip.
    selection-screen end of block a01.
    *& Start of main program
    start-of-selection.
    Validate Transaction Code
    select single * from tstc
    where tcode eq p_tcode.
    Find Repository Objects for transaction code
    if sy-subrc eq 0.
    select single * from tadir
    where pgmid = 'R3TR'
    and object = 'PROG'
    and obj_name = tstc-pgmna.
    move : tadir-devclass to v_devclass.
    if sy-subrc ne 0.
    select single * from trdir
    where name = tstc-pgmna.
    if trdir-subc eq 'F'.
    select single * from tfdir
    where pname = tstc-pgmna.
    select single * from enlfdir
    where funcname = tfdir-funcname.
    select single * from tadir
    where pgmid = 'R3TR'
    and object = 'FUGR'
    and obj_name = enlfdir-area.
    move : tadir-devclass to v_devclass.
    endif.
    endif.
    Find SAP Modifactions
    select * from tadir
    into table jtab
    where pgmid = 'R3TR'
    and object = 'SMOD'
    and devclass = v_devclass.
    select single * from tstct
    where sprsl eq sy-langu
    and tcode eq p_tcode.
    format color col_positive intensified off.
    write:/(19) 'Transaction Code - ',
    20(20) p_tcode,
    45(50) tstct-ttext.
    skip.
    if not jtab[] is initial.
    write:/(95) sy-uline.
    format color col_heading intensified on.
    write:/1 sy-vline,
    2 'Exit Name',
    21 sy-vline ,
    22 'Description',
    95 sy-vline.
    write:/(95) sy-uline.
    loop at jtab.
    select single * from modsapt
    where sprsl = sy-langu and
    name = jtab-obj_name.
    format color col_normal intensified off.
    write:/1 sy-vline,
    2 jtab-obj_name hotspot on,
    21 sy-vline ,
    22 modsapt-modtext,
    95 sy-vline.
    endloop.
    write:/(95) sy-uline.
    describe table jtab.
    skip.
    format color col_total intensified on.
    write:/ 'No of Exits:' , sy-tfill.
    else.
    format color col_negative intensified on.
    write:/(95) 'No User Exit exists'.
    endif.
    else.
    format color col_negative intensified on.
    write:/(95) 'Transaction Code Does Not Exist'.
    endif.
    Take the user to SMOD for the Exit that was selected.
    at line-selection.
    get cursor field field1.
    check field1(4) eq 'JTAB'.
    set parameter id 'MON' field sy-lisel+1(10).
    call transaction 'SMOD' and skip first screen.
    Regards

  • How to find out web-inf path from the physical drive?

    How to find out web-inf path from the physical drive?
    I have some user profiles in web-inf directory.SO I want to know the path from root directory like
    d:/program files/allaire/jrun/appname/web-inf/profiles/username like that.
    Presently I am able to get the path upto the application directory and from that I am concatinationg web-inf/profiles/username .
    But it is giving problems when it is deployed under unix or linux.Because web-inf there it treats as WEB_INF
    SO I want to get the path of web-inf directory with out hard coding.
    Thanku

    String path = application.getRealPath("/WEB-INF/profiles/username");
    Note sure why you need this, but you don't need the real path to read the file - you can get an InputStream using the relative path. See ServletContext getResource() and getResourceAsStream().

Maybe you are looking for