Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter Empty Directories in Package Explorer View

Tags:

eclipse

Is there a way in eclipse to filter/hide empty directory trees in the package explorer view?

This is different than filtering directories like '.svn' or maven's target, or filtering empty packages. It's more trying to clean up empty directories trees that show up as a result of filter rules.

Context- We have a generic project in our workspace that uses filters to ignore non text based files(mp3s, jpgs, etc). It allows us to quickly edit our files in eclipse. The problem is because of the filters there are a lot of empty folders present. If eclipse can ignore any empty folders due to filters it would make the project cleaner.

Update- I filed a bug report in eclipse's buzilla system for those that wish to have this feature: https://bugs.eclipse.org/bugs/show_bug.cgi?id=334052

like image 495
Matt Avatar asked Jan 07 '11 22:01

Matt


People also ask

How do I list empty folders?

Click to open My Computer. Choose the Search tab at the top line. In the opening Search Menu, set Size filter to Empty (0 KB) and check All subfolders option. From the list of the files and folders that don't take up any disk space, right-click the empty folder(s) and select Delete.

Which command will search and list empty directories?

Use the 'find' command along with the '-type' flag that specifies the directory type search using the keyword 'd'. The word '-empty' has been used as a flag to search only empty directories within the home directory as stated below. The dot means the current location which is the home directory of a Linux-based system.

Does git track empty folders?

git can't push empty directories. It can only track files. If you try to push a folder with nothing in it, although it will exist on your local machine, nothing will go into your branch. So if someone tries to clone your code, they won't have the same folder structure as you do on your local machine.

What is an empty working directory?

An empty directory is a directory that doesn't contain any file or directory. It's fair to say that empty files don't consume space, but we should clean our file system from time to time as a best practice. All the commands discussed in this tutorial are Linux-specific and won't work on Windows.


1 Answers

In Eclipse SDK (I use 3.6.2), to hide empty folders in the "Package Explorer":

At the top-right of the Package Explorer view, there's a downward-pointing triangle. If you hover your mouse pointer over it you'll see "View Menu".

  1. Click the "View Menu"
  2. Selected "Filters"
  3. Put a check next to "Empty Packages"
  4. Click OK

now your empty folders don't show any more.

like image 104
Someone Somewhere Avatar answered Oct 25 '22 16:10

Someone Somewhere