2019-03-12 18:16:00,899 [44799] INFO - .AliObjectStorageServiceAction - language = Language: JAVA 2019-03-12 18:16:00,899 [44799] INFO - .AliObjectStorageServiceAction - name = HelloOSS.java 2019-03-12 18:16:10,423 [54323] INFO - .AliObjectStorageServiceAction - project's base path = /Users/dong4j/Develop/codes/alibaba/aliyun-oss-java-sdk-demo-mvn 2019-03-12 18:16:14,372 [58272] INFO - .AliObjectStorageServiceAction - language = Language: TEXT 2019-03-12 18:16:14,372 [58272] INFO - .AliObjectStorageServiceAction - name = maven-demo.iml 2019-03-12 18:18:06,392 [170292] INFO - .AliObjectStorageServiceAction - language = Language: TEXT 2019-03-12 18:18:06,392 [170292] INFO - .AliObjectStorageServiceAction - name = 3-2-data-grip.md 2019-03-12 18:18:08,586 [172486] INFO - .AliObjectStorageServiceAction - project's base path = /Users/dong4j/Develop/knowledge
psiFile 还有其他的一些属性, 这个就 debug 看吧.
从上面我们知道了, 如果是 Markdown 文件, Language 为 TEXT, name 是文件名. 如果是类文件, 则是 JAVA. 可以使用 PsiJavaFile 来操作.