0

I need a way to get the directory path of an eclipse project by deserializining the .location file found in the eclipe workspace at:

.metadata\.plugins\org.eclipse.core.resources.projects\myproject\.location

Its contents look something like: @±‹#¼ %–磓¾ URI//file:/D:/proj/myproject ÀXûó#¼ QóŒ{»wÆ

so I would like to programmatically get the "D:/proj/myproject" string out of it.

Bonus points if the process doesn't use the Eclipse API.

1 Answers1

0

Eclipse read this file in the method LocalMetaArea.readPrivateDescription(..).

It uses a SafeChunkyInputStream and DataInputStream for reading it. It contains UTF8 strings and some integers.

For the complete code see

org.eclipse.core.internal.resources.LocalMetaArea at GrepCode.com

Robert
  • 39,162
  • 17
  • 99
  • 152