VirtualFile for a filename without path?

Hi,
I'd like to assign a certain file type to files without extension (i.e. bash scripts).
I managed this by using FileTypeConsumer.consume(FileType, FileNameMatcher) .
FileNameMatcher only get ths file without path, though.

Now I only want accept those files which begin with the shebang line (#!/bin/sh).

How can I get the full path to the file?

Thank you!
Wallaby

1 comment
Comment actions Permalink

Hello Wallaby,

You can't. The type of a virtual file must be determined by its name only,
without looking at its content.

I'd like to assign a certain file type to files without extension
(i.e. bash scripts).
I managed this by using FileTypeConsumer.consume(FileType,
FileNameMatcher) .
FileNameMatcher only get ths file without path, though.
Now I only want accept those files which begin with the shebang line
(#!/bin/sh).

How can I get the full path to the file?

=--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.