How find out package of java class?

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()


Please sign in to leave a comment.