Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は長い間これに苦労してきました。
外部 API を使用しており、ファイルのパスを直接渡す必要があります。変更できません。
私は次のようになります: functionmethod(String path);
パスだけを渡す必要があるため、リソースを使用できません。
SPRINGでも可能ですか?
多分あなたは使うことができます:
(new File("")).getAbsolutePath()これにより、現在のパス (アプリケーション) が得られます。
(new File("")).getAbsolutePath()
または(こちらの方が適していると思います)
getResource("fileName").getFile()