Finding Folder Size including subfolders and files

Hi Friends,
Could you please Help in getting a Folder size through pure java.The folder contains subfolders and files.I have done rest of the things related to file operation and i can help in other things if you could please help in this regard.
thanks and regards
Avanish
Avanish Kumar Singh
Software Engineer
Samsung SDS India Development Center
Bangalore-560 001
[email protected]
[email protected]

thanks bbrita !
I too did the way it has given in reply but thats taking huge resource so if you know any direct way to find the directory size please let me know.
thanks and regards
avanish

Similar Messages

  • Does MacOS recognize Windows directory structure? Can I move an entire folder (consisting of subfolders and files) from Windows to Mac?

    Can I move an entire folder (consisting of subfolders and files) from Windows to Mac?

    Mustafafromnc,
    if you’re talking about a USB drive, then it will probably have an exFAT filesystem. Modern versions of OS X can read from and write to exFAT filesystems without problems, so you would be able to move Windows folders, subfolders, and files from an exFAT filesystem to an OS X filesystem.

  • I have the following Imac and Iphoto 11 in Finder folder I upgrade the iphoto file  and  all the latest event files, can you help how to solve the problem? Thank you  Model Name iMac    Model Identifier:     iMa

    I have the following Imac and Iphoto 11 in Finder folder I upgrade the iphoto file  and I lost all the latest event files, can you help how to solve the problem? Thank you
    Model Name:     iMac
    Model Identifier:     iMac8,1   Processor Name:     Intel Core 2 Duo
    Processor Speed:     2.4 GHz

    http://support.apple.com/kb/HT2638?viewlocale=en_US&locale=en_US

  • Delete subfolders and files

    On Mac OS X Lion i'm  setting the permission for a share point to a user. under "Write" submenu when i uncheck the two checkboxes "Delete" and "Delete Subfolders and file" so that the user won't be able to delete data from the server. the issue is that with this setting the user won't be able to create folders and subfolders and also rename.
    "Inheritance" boxes are all checked.
    Any suggestions on how to fix that will bve greatly appreciated.
    thanks.

    Do you mean the SMSAdminUI.log file from E:\Program Files\Microsoft Configuration Manager\AdminConsole\AdminUILog ? If so the file hasn't been modified since 3/14. It has some items highlited in red that I have listed below.  That is the only AdminUI.log
    I could find.  Thanks.
    [14, PID:2232][03/14/2013 13:37:11] :Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlQueryException\r\nThe SMS Provider reported an error.\r\n   at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Get(ReportProgress
    progressReport)
       at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObject.Get()
       at Microsoft.ConfigurationManagement.AdminConsole.Conditions.MenuUtilityClass.EnableDisableCloseAlertMenuStatus(Object sender, ScopeNode scopeNode, ActionDescription action, ResultObjectBase selectedResultObject)\r\nConfigMgr Error Object:
    instance of SMS_ExtendedStatus
    Description = "Error retrieving object ID=16777224";
    ErrorCode = 2151811598;
    Über Random

  • Hey when ever i download and install Itunes then i open it says error finding folder please re download and I tried a tons of times and it didn't work. Does anyone know how to fix this?

    Hey when ever i download and install Itunes then i open it says error finding folder please re download and I tried a tons of times and it didnt work. Does anyone know how to fix this?

    Hi Beege140,
    I have an article for you that will help you address this launch issue with iTunes:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/TS1717
    Thanks for being a part of the Apple Support Communities!
    Cheers,
    Braden

  • Finder Folder Size Calculations

    When I'm archiving, I have to do a lot of Get Info to calculate the folder sizes for DVD burning. Problem I'm having is the file size calculations start taking forever after working for a few minutes, or they don't calculate at all. Usually works fine when I start but after a minute or so It's like the computer get's tired and just stops. Even if it's a 1mb folder it will have trouble.
    Is this normal? Seems really odd that something so incredibly simple can make my archiving process so difficult.
    Files reside on a network HD.
    Thanks for any help.

    I'd create a disk image of appropriate size, mount it, copy items to it until it tells you there's no more room. Then, burn it.

  • Finding the size of db and size of used space

    Greetings all good people.
    Can you please help me find out about 2 database information?
    One, I want to find out the size of a database =size of physical files.
    and the size of data which is the size occupied in physical files.
    We are about to start a new project and there is a table on the database but it is empty.
    We want to be exporting data into this table but we want to make sure that there is enough space on the db before we start populating the table with data.
    I believe the code below just gives me the size of the database.
    select (bytes/1024/1024) as total_gigs from dba_segments where owner='BELL' and segment_name='$TABLE_NAME
    But I want to know the total size of the database and how much size has been used already, much the same as you would want to know the size capacity of a hard drive and how much of the size has been used.
    Sorry if my request is confusing.
    Thanks a lot in advance

    db size can be found out
    select sum(bytes)/1024/1024/1024 from dba_data_files ;
    and size of data is -- in the datafiles
    select sum(bytes)/1024/1024/1024 from dba_segemnts ;
    You can find out by below query .. the tablespace sizes -- would be DBSIZE
    used space -- would be the actual occupied space.
    select t.tablespace, t.totalspace as " Totalspace(MB)",
    round((t.totalspace-nvl(fs.freespace,0)),2) as "Used Space(MB)",
    nvl(fs.freespace,0) as "Freespace(MB)"
    from
    (select round(sum(d.bytes)/(1024*1024)) as totalspace,d.tablespace_name tablespace
    from dba_data_files d
    group by d.tablespace_name) t, (select round(sum(f.bytes)/(1024*1024)) as freespace,f.tablespace_name tablespace
    from dba_free_space f
    group by f.tablespace_name) fs
    where t.tablespace=fs.tablespace (+)
    order by t.tablespace

  • Private strand flush not complete how to find optimal size of redo log file

    hi,
    i am using oracle 10.2.0 on unix system and getting Private strand flush not complete in the alert log file. i know this is due to check point is not completed.
    I need to increase the size of redo log files or add new group to the database. i have log file switch (checkpoint incomplete) in the top 5 wait event.
    i can't change any parameter of database. i have three redo log group and log files are of 250MB size. i want to know the suitable size to avoid problem.
    select * from v$instance_recovery;
    RECOVERY_ESTIMATED_IOS     ACTUAL_REDO_BLKS     TARGET_REDO_BLKS     LOG_FILE_SIZE_REDO_BLKS     LOG_CHKPT_TIMEOUT_REDO_BLKS     LOG_CHKPT_INTERVAL_REDO_BLKS     FAST_START_IO_TARGET_REDO_BLKS     TARGET_MTTR     ESTIMATED_MTTR     CKPT_BLOCK_WRITES     OPTIMAL_LOGFILE_SIZE     ESTD_CLUSTER_AVAILABLE_TIME     WRITES_MTTR     WRITES_LOGFILE_SIZE     WRITES_LOG_CHECKPOINT_SETTINGS     WRITES_OTHER_SETTINGS     WRITES_AUTOTUNE     WRITES_FULL_THREAD_CKPT
    625     9286     9999     921600          9999          0     9     112166207               0     0     219270206     0     3331591     5707793please suggest me or tell me the way how to find out suitable size to avoid problem.
    thanks
    umesh

    How often should a database archive its logs
    Re: Redo log size increase and performance
    Please read the above thread and great replies by HJR sir. I think if you wish to get concept knowledge, you should add in your notes.
    "If the FAST_START_MTTR_TARGET parameter is set to limit the instance recovery time, Oracle automatically tries to checkpoint as frequently as necessary. Under this condition, the size of the log files should be large enough to avoid additional checkpointing due to under sized log files. The optimal size can be obtained by querying the OPTIMAL_LOGFILE_SIZE column from the V$INSTANCE_RECOVERY view. You can also obtain sizing advice on the Redo Log Groups page of Oracle Enterprise Manager Database Control."
    Source:http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10752/build_db.htm#19559
    Pl also see ML Doc 274264.1 (REDO LOGS SIZING ADVISORY) on tips to calculate the optimal size for redo logs in 10g databases
    Source:Re: Redo Log Size in R12
    HTH
    Girish Sharma

  • How do I find the size of a video file in iTunes store?

    Is there any way to find out how big a video file is before I download it to my computer? I see that movies show the file size in the product description, but what about episodes of a TV show? Or a complete season? Or a video in iTunes U?
    I tried "right clicking" (or whatever that's referred to on a Mac, sorry, I just recently got my Mac) to get info on a few files, but it says the size is unavailable. I have an iPod Touch I'd like to get videos for, but I don't have a ton of space after putting all my music on it, so that's why I'd like to know the file sizes in advance.

    You can figure for a 1 hour TV show - about 40-45 minutes of video - you will have a file size of about 450-550 meg.
    A movie such as Pirates of the Carri..... will weigh in around 1.6-1.8 gig.
    MJ

  • How to find total size of RMAN backup files?

    Hi there
    env: Oracle 10gR2, RHEL 64bit
    My client has a production database where rman backups are taken: Level-0 backup every Sunday and Level-1 Monday thru Saturday.
    I have very limited access to this production database because it is being managed by third party and they won't provide me my required info (not sure why). I do not have access to their rman repository. To connect to the database I have to login to an intermediate server and then login to the database server. I have no access to Enterprise Manager. So in short, my access is limited. I want to gather the information on total size of rman backup files - both for a Level-0 and Level-1 backups separately. I understand that this info can be retrieved from rman repository. Are there any data dictionary views/tables where I may get this info?
    Best regards

    Hi,
    Have you searched in  forum check this:https://forums.oracle.com/thread/1097939
    HTH

  • How to copy the whole directory including subdirectories and files in java

    i have written the code for copying the directory with subdirectories.but directory is copying .but its subdirectories and files are not copying.please tell me how to solve this problem
    import java.io.*;
    public class copy
    private void copyFile(File src, File dst) throws IOException
    InputStream in = new FileInputStream(src);
    OutputStream out = new FileOutputStream(dst);
    // Transfer bytes from in to out
    byte[] buf = new byte[1024];
    int len;
    while ( (len = in.read(buf)) > 0) {
    out.write(buf, 0, len);
    in.close();
    out.close();
    public int copyDirectory(File srcDir, File dstDir) throws IOException
    if (srcDir.isDirectory())
    if (!dstDir.exists())
    dstDir.mkdir();
    String[] children = srcDir.list();
    int c= children.length;
    System.out.println(c);
    for (int i = 0; i < children.length; i++) {
    copyDirectory(new File(srcDir, children),
    new File(dstDir, children[i]));
    else {
    // This method is implemented in e1071 Copying a File
    copyFile(srcDir, dstDir);
    return 1;
    public static void main(String args[]) throws IOException {
    copy c = new copy();
    c.copyDirectory(new File("d:/puvvada/sub "),new File("d:/sub"));
    c.copyFile(new File("d:/puvvada/sub/auth.html"),new File("d:/sub/auth.html")) ;

    It is NOT a ""here's my spec". As simple as it is.
    And of course I know help here is free as in other thousands of forums
    That is not really the issue.  You have already noted that this is not as simple as you thought.  There have been at least three statements in reponse to your request.  The reasons for these statements are that you are asking for someone to
    write a script that is not a simple script.  YOu canwrite a script and post it with questions and your questions will be answered.
    I posted before that you cannot copy applications like Office between systems.  They must be installed.  Office and most other applications can g\be installed by Group Policy.  This -is how we normally do this in Windows.  There is normally
    no other way to do this for a large number of systems.
    For large numbers of arbitrary file we would normally use RoboCopy.  The issues you have had with RoboCopy can be overcome by setting the correct options.  If you are trying to copy Office or other applications you sill likely find that many files
    are locked.  This cannot be overcome by any copy method.  This is one of many reasons why we use Installers for applications.
    I suggest that you learn the basics of Windows and how it manages applications and files.  Getting the fundamentals clear will help you to understand how to perform basic tasks in a Windows network.
    If you really need help with this then you need to step back and explain exactly what is being copied and why.  I can think of no real world scenario where what you are asking for is necessary.  If you can  explain that perhaps we can point
    you at a usable solution.
    Just keep in mind that you cannot remotely install Office or most applications by copying the files.  This has always been true in  Windows.
    ¯\_(ツ)_/¯

  • Finder folder size

    the status bar at the bottom of the finder window shows the # of files and the free space avaiable on the harddrive. Is there a way to make the finder show the total size of the contents of a folder? either in the status bar while you are in a folder, or in the main pain when a list of folders are shown.
    Thanks.

    In Finder List View, you can have the Finder calculate the size of Folders, however, it is very disk (I/O) intensive
    Finder -> View -> Show View Options -> Calculate all sizes
    If you have a solid state drive, this might not be too expensive (in time and power), but on a rotating disk, it eats your battery power, makes your disk busy when you want it to do other things, and takes time.
    Enabling it to maybe check for large folder trees can be useful, but for that I would just download and use OmniDiskSweeper (free)
    <http://www.macupdate.com/info.php/id/7402/omnidisksweeper>

  • Automator or Applescript to Rename Subfolders and Files

    I have 200 Gigs of files that need to be moved from a Mac's internal drive onto an external non-mac formatted drive for storage (Buffalo TeraStation). Obviously there is an issue with illegal characters in some of my filenames and folder names. I was able to create a workflow in Automator to replace illegal characters in the Filenamnes and nested filenames with the characters of my choice however it did not work for the Sub Folder names. Does anyone know if this is possible in Automator? If not, is there someone out there who can write a script for such a process?
    Thank you in advance.

    Scott,
    Here is an AppleScript which can be placed in an Automator "Run AppleScript" action to do what you are want.
    Click on the link to move the script into Script Editor. Then select all, copy and paste into a "Run AppleScript" action in Automator. Make sure to completely replace all of the text in the action i.e., don't just replace the (* Your script goes here *).
    The find and replace characters are found in the properties at the top of the script so they can be adjusted to what you need. I also have a routine that will replace multiple illegal characters with a single legal character if you need that type of flexibility.
    This action should be proceeded by an action that will supply an alias such as "Get Specified Finder Items".
    click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">property theIllegalCharacter : "/"
    property theReplacementCharacter : "_"
    on run {input, parameters}
    tell application "Finder"
    set theFinderWindow to make new Finder window
    set current view of theFinderWindow to column view
    set target of theFinderWindow to item 1 of input
    set theIllegallyNamedSubFolders to folders of entire contents of target of theFinderWindow whose name contains theIllegalCharacter
    set theIllegallyNamedFiles to files of entire contents of target of theFinderWindow whose name contains theIllegalCharacter
    repeat with thisFile in theIllegallyNamedFiles
    set (name of thisFile) to my RemoveIllegalNamingCharacters(name of thisFile, theIllegalCharacter, theReplacementCharacter)
    end repeat
    repeat with thisFolder in theIllegallyNamedSubFolders
    set (name of thisFolder) to my RemoveIllegalNamingCharacters(name of thisFolder, theIllegalCharacter, theReplacementCharacter)
    end repeat
    end tell
    return input
    end run
    to RemoveIllegalNamingCharacters(theName, IllegalCharacter, ReplacementCharacter)
    set theNewName to ""
    set theCharacterCount to (length of theName)
    repeat with i from 1 to (length of theName)
    if (character i of theName) is equal to IllegalCharacter then
    set theNewName to theNewName & ReplacementCharacter
    else
    set theNewName to theNewName & character i of theName
    end if
    end repeat
    return theNewName
    end RemoveIllegalNamingCharacters
    </pre>
    PowerBook 12"   Mac OS X (10.4.7)  

  • File -- New Folder creates 2 folders, and files dissapear when I move them

    Hi. I am having a rather bizarre problem. When I am using Finder, I go to File --> New Folder and an "untitledfolder" appears. However, two of them appear. I rename one and leave the other alone. When I move files into the named folder, they disappear! I cannot delete either folder, but sometimes I can.
    Also bizarre, say I have repeated the process above 4 times, naming folders "temp1" "temp2" etc. I delete the folders. If I try to create a new folder with the name "temp1" I get a message "folder with that name already exists," even if the folder appears to be deleted.
    If I try to delete them and close then reopen the Finder window, "temp1" will show up. When I click on "temp1" the name changes to another folder I tried to create, such as "temp2". All the folders are empty.
    Does anybody have any explanation for this weird behavior?
    ~Kelly

    I had the same problem on an external drive connected wia FW. I am also confuse about the bahaviour of Finder. I am very new on Mac and I used until now Windows and Dos. Finder does not have a rigid tree path between files and folders. Especially in columns wiev it is terrible; you see the same file in different places and it is difficoult to manage them. Sinde I am migrating from a Win PC and I have several external HD to transfer I already made the mistake do delete something. Furtunately I have many BU copies but I feel like driving blind in fog. I will appreciata any help on how to limit the finder to a normal "file manager of the old good dos". It is a bug that will be fixed or will it remain this way ??? Or it is me not understanding the way to use it ???
    Thanks

  • I had to reinstall my OSX and now can't find all of my music and files

    My system was not verifying all of the files that I required to run optimally so the system told me to reinstall my disk 1 of my OSX.  I did that and then had to f/u with the Snow Leopard CD. 
    Now I can't seem to find any of my music/files and it's like it's back to factory setting because none of our family profiles are on there or our email set up anymore. 
    Can anyone help me?

    Hi Eric,  I actually ended up taking it in to the apple store and the tech helped me.  I do have an external back up but he had to 'trick' it somehow.  (Something I would not have had a clue how to do)
    It's all good ! 

Maybe you are looking for

  • Issue with AjaxControlToolkit for SharePoint 2013 Blog site template.

    Hi, Please find below the details of issue - History - We are working with SharePoint 2013 and we are using AjaxControlToolkit in our project. Basically this is a migration project from MOSS to SharePoint 2013. So we have migrated code MOSS to ShareP

  • Apps no longer in Library after upgrading to 10.5.1.42 - help!

    After I upgraded iTunes to 10.5.1.42, all my apps disappeared from my iTunes library.  The one sone that was there has disappeared as well.  It's as if iTunes lost the entire library.  Any suggestions on how to recover?

  • How to delete the hdd and re-partition during the installation.

    Hi, I am new to Arch, currently I have a laptop that installed with Opensuse os, now I want to switch it to Arch entirely. So, I need to delete the whole partitions that previously created when install Openesuse. I just want to install single Arch on

  • Can multiple HTTP redirects be applied to the same VIP

    Greetings all, My customer would like to have two redirects to be applied to the same VIP. Example: VIP configured name is https://test.company.com redirect the following: http://site1.company.com to https://test.company.com http://site2.company.com

  • I'm trying to play a video

    I'm thrying to play a video on the children in need website on my macbook air but it won't play. Can anyone help, do i need some kind of plug in?