Javascript Useful Resources

Finding out whether the browser is Google Chrome [javascript] isChrome = /Chrome/.test(navigator.userAgent) &amp;&amp; /Google Inc/.test(navigator.vendor); [/javascript] Getting element by class name and changing styles [javascript] var arr = document.getElementsByClassName(“ui-datepicker-trigger”); var arrLength = arr.length for (i = 0; i < arrLength; i++) { arr[i].textContent=” “; arr[i].style.height=”15px”; arr[i].style.padding=”4px”; } [/javascript] Getting element by id and appending style’s

Searching file types with PathMatcher

The PathMatcher class allows us to search any file name or file extension. you can use regex or glob elements to find files. The PathMatcher only seeks the given keyword in the working directory only, It will not search the subdirectories. If you want to seek it in a given path, you should empower it,

FileVisitor Interface Sample

In this sample file visitor interface you can list all the folders and their regarding files   import; import java.nio.file.FileVisitResult; import java.nio.file.FileVisitor; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class MyFileVisitor implements FileVisitor<Path> { private Map<String, List<String>> data = new HashMap<>(); private Map<String, IOException>

File and Directory Attributes

File and Directory Attributes With these features Java allows us to read and modify file and folder attributes for all supported operating systems such as Windows and Unix families. There are a couple of ways to read and alter data by using Files and the regarding interface. If a file or folder does not support