GrammarScope  4.0.0
Static Public Member Functions | Private Member Functions | List of all members
grammarscope.common.utils.FileUtils Class Reference

Static Public Member Functions

static String getVersion (final String archive)
 
static String findClassPathElement (final String pattern)
 
static ZipEntry findInJar (final File file, final String pattern) throws IOException
 
static ZipEntry findInJar (final JarFile jar, final String pattern)
 
static ZipEntry findInJar (final ZipInputStream jarInputStream, final String pattern) throws IOException
 
static URI findArchive (final String archiveName)
 
static Pair< InputStream, Long > makeInputStream (final String path) throws IOException
 
static ObjectInputStream makeMonitoredInputStream (final String path, final String message, final Component parentComponent) throws IOException
 
static String trimPath (final String path0)
 
static String extractText (final String query)
 
static void main (final String[] args)
 

Private Member Functions

 FileUtils ()
 

Detailed Description

File DialogUtils

Author
Bernard Bou

Constructor & Destructor Documentation

◆ FileUtils()

grammarscope.common.utils.FileUtils.FileUtils ( )
private

Member Function Documentation

◆ extractText()

static String grammarscope.common.utils.FileUtils.extractText ( final String  query)
static

Extract text from query

Parameters
queryquery
Returns
text or query if failed

◆ findArchive()

static URI grammarscope.common.utils.FileUtils.findArchive ( final String  archiveName)
static

Find archive in path or runnable

Parameters
archiveNamearchive name
Returns
archive's uri

◆ findClassPathElement()

static String grammarscope.common.utils.FileUtils.findClassPathElement ( final String  pattern)
static

Find file path matching pattern in classpath

Parameters
patternpattern
Returns
path

◆ findInJar() [1/3]

static ZipEntry grammarscope.common.utils.FileUtils.findInJar ( final File  file,
final String  pattern 
) throws IOException
static

Find entry in JAR file

Parameters
filearchive file
patternpattern
Returns
jar entry with matching file path
Exceptions
IOExceptionexception

◆ findInJar() [2/3]

static ZipEntry grammarscope.common.utils.FileUtils.findInJar ( final JarFile  jar,
final String  pattern 
)
static

Find entry in JAR file

Parameters
jarJarfile
patternpattern
Returns
jar entry with matching file path

◆ findInJar() [3/3]

static ZipEntry grammarscope.common.utils.FileUtils.findInJar ( final ZipInputStream  jarInputStream,
final String  pattern 
) throws IOException
static

Find entry in JAR stream

Parameters
jarInputStreamjar input stream
patternpattern
Returns
jar entry with matching file path
Exceptions
IOExceptionexception

◆ getVersion()

static String grammarscope.common.utils.FileUtils.getVersion ( final String  archive)
static

Get version (=manifest time stamp)

Parameters
archivearchive to look for
Returns
path

◆ main()

static void grammarscope.common.utils.FileUtils.main ( final String[]  args)
static

Main

Parameters
argsunused

◆ makeInputStream()

static Pair<InputStream, Long> grammarscope.common.utils.FileUtils.makeInputStream ( final String  path) throws IOException
static

Get stream

Parameters
pathpath to grammar
Returns
input stream, content-length
Exceptions
IOExceptionexception

◆ makeMonitoredInputStream()

static ObjectInputStream grammarscope.common.utils.FileUtils.makeMonitoredInputStream ( final String  path,
final String  message,
final Component  parentComponent 
) throws IOException
static

Get monitored stream

Parameters
pathpath to grammar
messagemessage
parentComponentparent component
Returns
input stream
Exceptions
IOExceptionexception

◆ trimPath()

static String grammarscope.common.utils.FileUtils.trimPath ( final String  path0)
static

Trim path

Parameters
path0path
Returns
trimmed path

The documentation for this class was generated from the following file: