How find out package of java class?

Hello!
How do I get the package of a PsiFile or a VritualFile of a Java class? Do I have to check the contents (the code) of the file to get the package? Or is there any easier way?

1 comment
Comment actions Permalink

((PsiJavaFie) psiFile).getPackageName()

0

Please sign in to leave a comment.