Giter Club home page Giter Club logo

searchdir's Introduction

SearchDir

Object-Oriented Analysis and design class project for directory searching and difference comparison.

Basic Structure

  • builderModel: Store file and directory model class.Both of the model class use Builder pattern.
  • modeFactory: Store factory classes's codes,using Factory pattern here.
  • decoratorFilter: Store codes related to condition search ,using Decorator pattern here.
  • gui:Codes about gui.Here I'm using JavaFX to build the interface
  • sortStrategy: Store codes related to sorting directory files according to some rules,using Strategy pattern here.

Design

  • Use SFile to represent file object
  • Use SDirectory to represent directory object
  • Use FileListManager to store specific directory's files info,use Singleton pattern to avoid unneeded instance of this manager class.
  • Use Sort interface,and let other sorting method implements it
  • Use CondictionFilter interface,as ancient class of other condition filters
  • Use ModeFactory,return objects that implement Mode interface.
  • InfoGetter, get directory infos and make itself a decoratee,become capable to retrieve file infos filtered byCondiction

UML Design

UML

Usage

  • Run SearchGui for most of the functions with nice interface
  • Or InfoGetter.main() for only search by some criterias

Running screenshots

Basic:

  • Before Search

before

In log mode,you can search directories for result,but you can't use compare button.

  • First Search

first

The output will show in left window.Of course you can choose whichever side of window you want by toggling the combobox "left/right"

  • Second Search

second

Now that that directory you search on your disk has changed,it will show new infos at right window at default.

Till now,the program has automatically written info into logs.Now switch to compare mode:

compare

Then click compare button on main screen,then you might see something like this:

compare_result

compare_result

Then we know some files were removed from original place.

If there is any new file added in,you can see the changes too in differ log

Extra and command mode

You can use other sorting method while searching for directories infos:

sort_method

And you can search for some files with some condition under command line mode:

command1

command2

About:

about

What can it do?

  • Normal mode:

    • Given a directory path,outputs all directories and files' info on gui.
    • Automatically save above infos into a log file.
    • Be able to choose sorting method through a combobox.
    • Read log files that are already exist through gui.
    • If enter the same path twice into search box to search infos, it will build a new.txt log file.
    • Entering different path to search in this mode won't build new log file(or can't update new log)
  • Compare mode:

    • If info of searched dirs have changed on your machine,when in compare mode, it will generate a differ.txt file to show the old and new structure's difference
    • Make sure to have an old and new log file of same path first!(Otherwise compare will be meaningless)
  • Command line mode(InfoGetter):

    • According to fileSizefileTypefileLastEdit to search for matches and output in the console.

Noted

If you are confused about the comparison result,check the ori,new and differ log file.

If you want to see more about how design pattern is implemented in Java,check out my repo here: JavaDPImpl

searchdir's People

Contributors

wendyltan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.