Hierarchical/tree database for directories path in filesystem

Here’s a quick closure table example for SQLite. I’ve not included the statements for inserting items into an existing tree. Instead, I’ve just created the statements manually. You can find the insert and delete statements in the Models for hierarchical data slides. For the sake of my sanity when inserting the IDs for the directories, … Read more

How to check if a path points to an existing file with Java 7’s new File API?

Use the Files class: Files.exists(path); EDIT: to answer your subsequent question, I think the reason that the method is in another class is that Path is an interface, and they wanted to provide an implementation (similar to putting sorting methods in the Collections class instead of the List interface). Not directly related to the question, … Read more

How to draw smooth / rounded path?

Maybe this will create what you want paint.setColor(color); // set the color paint.setStrokeWidth(size); // set the size paint.setDither(true); // set the dither to true paint.setStyle(Paint.Style.STROKE); // set to STOKE paint.setStrokeJoin(Paint.Join.ROUND); // set the join to round you want paint.setStrokeCap(Paint.Cap.ROUND); // set the paint cap to round too paint.setPathEffect(new CornerPathEffect(10) ); // set the path effect … Read more