Skip to main content

"bluray.vfs.root"

20 replies [Last post]
terymas
Offline
Joined: 2007-09-03
Points: 0

Hi everybody,

In a wonderfull book page 17-10 ; )

"Using the bluray.vfs.root system proprety gives you the direct path of the disc's filesystem"

I don't know, how to use "bluray.vfs.root" and my java app for do that.

Thank you for help

Tery

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joe Rice

2themax -

Thanks for the correction. It looks like reading the bluray.vfs.root
system property is what requires a signed app (11.9.1.1 of the BD 3-2
spec), however no PRF is needed for this. If you could guess the
location of the mount point of the disc you might not need to sign
your app, but that would be pretty tricky. ;)

Cheers,
Joe

On Mar 21, 2008, at 8:53 AM, bd-j-dev@mobileandembedded.org wrote:

>> Is a signed app necessary to read files from the
>> disc?
> According to the BD-J Guidelines, it is. Take a look at Section 5.1.
> An unsigned application invoking "bluray.vfs.root" will fail.
> [Message sent by forum member '2themax' (2themax)]
>
> http://forums.java.net/jive/thread.jspa?messageID=265202
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

2themax
Offline
Joined: 2008-01-22
Points: 0

Welcome Joe. My current Java title is using this exact approach. Load times are much better than if the assets were in a Jar.

I took the time to test the idea of not signing the application and creating a disc. It failed on every standalone player. It played in PowerDVD though. Wonder if Cyberlink knows they are violating spec?

> 2themax -
>
> Thanks for the correction. It looks like reading the
> bluray.vfs.root
> system property is what requires a signed app
> (11.9.1.1 of the BD 3-2
> spec), however no PRF is needed for this. If you
> could guess the
> location of the mount point of the disc you might not
> need to sign
> your app, but that would be pretty tricky. ;)
>
> Cheers,
> Joe

dbreitenfeld
Offline
Joined: 2007-03-18
Points: 0

Hi 2themax,

[i]correction[/i] I've been told the latest version we received from Cyberlink is now compliant with the spec.

Denny B.
-------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio Blu-ray Team - DSA - http://dostudio.netblender.com [/i]

Bill Foote

Hi Joe,

> Is a signed app necessary to read files from the disc? My understanding
> was that reading files from the ADA or BUDA required signing, but
> reading files from the disc only required the appropriate file access
> setting in the BDJO.
>
> This from MHP, 11.10.1, "Permissions For Unsigned Applications"
>
> 11.10.1.6 java.io.FilePermission
> A read permission shall be granted for the subtree under which the
> implementation mounts the object carousels.

Right. The deal here is that "mounting an object carousel" in MHP
is mapped to mounting the JAR file that the application comes from.
There's a different system property starting with "dvb." that gives
this mount point.

the vfs.root property gives the mount point of the whole disc, so it's
more powerful.

So you're right - a signed app is not necessary to read files from
the disc, but only for those files that are in the subdirectory where
the xlet's JAR is mounted. For the rest of the disc's filesystem, you
do need a signed app.

Cheers,

Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

Joe Rice

Is a signed app necessary to read files from the disc? My
understanding was that reading files from the ADA or BUDA required
signing, but reading files from the disc only required the appropriate
file access setting in the BDJO.

This from MHP, 11.10.1, "Permissions For Unsigned Applications"

11.10.1.6 java.io.FilePermission
A read permission shall be granted for the subtree under which the
implementation mounts the object carousels.

Joe

On Mar 21, 2008, at 6:43 AM, bd-j-dev@mobileandembedded.org wrote:

> The code below will allow access to a specified folder on the disc.
> Is this case it's /BDMV/JAR/00000/.
>
> private String rootDirectory = System.getProperty("bluray.vfs.root");
> private String dirPath = rootDirectory+File.separator
> +"BDMV"+File.separator+"JAR"+File.separator+"00000"+File.separator;
>
> In addition to that, you will also need a permissions file for the
> main xlet, the Jar file will need to be signed, and a corresponding
> app.discroot.crt will need to be created and placed in the
> CERTIFICATE folder.
> [Message sent by forum member '2themax' (2themax)]
>
> http://forums.java.net/jive/thread.jspa?messageID=265178
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

[att1.html]

2themax
Offline
Joined: 2008-01-22
Points: 0

> Is a signed app necessary to read files from the
> disc?

According to the BD-J Guidelines, it is. Take a look at Section 5.1. An unsigned application invoking "bluray.vfs.root" will fail.

Message was edited by: 2themax

dbreitenfeld
Offline
Joined: 2007-03-18
Points: 0

Hi Joe,

I believe you are correct that an unsigned .jar just doesn't have access to the Binding Unit Data Area, as long as the RPF has the right permissions in it. However it seems certain players have not followed this. Unless we are reading things incorrectly. Right now DSA will generate a certificate and sign the .jar files as well as create the perm file for maximum reliability. This is something maybe everyone should do till it is clear and implementations have been updated. I think all Hollywood titles do both right?

Cheers,

Denny B.
-------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio Blu-ray Team - DSA - http://dostudio.netblender.com [/i]

dbreitenfeld
Offline
Joined: 2007-03-18
Points: 0

Correction: Like Joe said as long as the perm file and the BDJO have the correction info a signed app isn't necessary??

terymas
Offline
Joined: 2007-09-03
Points: 0

Hi,

Of course, I can to tell you : )
With the good Organization ID ; )

In my authoring software, the orgid is 0x1 but in fact it's 0x7fff0001

I have modified the prem file with this new number and rock'n'roll !!!

Tery

cgonzalez509
Offline
Joined: 2010-01-19
Points: 0

Ok, I am still having errors reading from a jar different than the container of the main xlet in disk!
1- Main class xxxx.Test.class
2- bluray.Test.perm located in the xxxx folder contains:





*


3- The assets are located in a jar located in BDMV\JAR\00004.jar
4- The 00004.jar fle has been signed using the net.java.bd.tools.security.BDSigner tool. This is the portion of the build.xml
...




...

5- In xxxx.Test.java code, I create an instance of DVBClassLoader
...
DVBClassLoader cl = DVBClassLoader.newInstance(
new URL[]{new URL("bd://JAR:00004/")});

6- I check the permissions related with a file in that jar:
FilePermission f3= new FilePermission(
cl.getResource("diskFile.txt").toString()
, "read");
AccessController.checkPermission( f3); // OK

7- I print out the value of f3.getName() that is [file:C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt]

8- I try to read the file:
URL u = new URL(f3.getName());
BufferedReader fr = new BufferedReader(
new InputStreamReader(u.openStream()));
String line = fr.readLine();

9- This execution throws a java.security.AccessControlException (access denied (java.io.FilePermission C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt read))

?????- Could someone explain me why the AccessController in point 6 checks the file [file:C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt] and the AccessController in point 8 checks the file [C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt]???

Thanks,

Joe Rice

I wonder if you meed to add it to the BDJO application cache and attach it as a service domain using org.dvb.dsmcc.SeviceDomain#attach()? (See BD-ROM 3-2 11.5.1)

Cheers,
Joe

On Feb 25, 2010, at 9:04 AM, bd-j-dev@mobileandembedded.org wrote:

> Ok, I am still having errors reading from a jar different than the container of the main xlet in disk!
> 1- Main class xxxx.Test.class
> 2- bluray.Test.perm located in the xxxx folder contains:
>
>
>
>
>
> *
>

>
>

>
> 3- The assets are located in a jar located in BDMV\JAR\00004.jar
> 4- The 00004.jar fle has been signed using the net.java.bd.tools.security.BDSigner tool. This is the portion of the build.xml
> ...
>
>
>
>

> ...
>
> 5- In xxxx.Test.java code, I create an instance of DVBClassLoader
> ...
> DVBClassLoader cl = DVBClassLoader.newInstance(
> new URL[]{new URL("bd://JAR:00004/")});
>
> 6- I check the permissions related with a file in that jar:
> FilePermission f3= new FilePermission(
> cl.getResource("diskFile.txt").toString()
> , "read");
> AccessController.checkPermission( f3); // OK
>
> 7- I print out the value of f3.getName() that is [file:C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt]
>
> 8- I try to read the file:
> URL u = new URL(f3.getName());
> BufferedReader fr = new BufferedReader(
> new InputStreamReader(u.openStream()));
> String line = fr.readLine();
>
> 9- This execution throws a java.security.AccessControlException (access denied (java.io.FilePermission C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt read))
>
> ?????- Could someone explain me why the AccessController in point 6 checks the file [file:C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt] and the AccessController in point 8 checks the file [C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt]???
>
>
>
> Thanks,
> [Message sent by forum member 'cgonzalez509' (cgonzalez@ita.es)]
>
> http://forums.java.net/jive/thread.jspa?messageID=388732
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

Joe Rice

Hmm, it looks like one method we've used to access arbitrary files in JARs is by creating a java.util.jar.JarFile reference to the JAR (using a file path as opposed to a locator) and then a java.util.jar.JarEntry reference to the file, using JarFile#inputStream() to read data from the JarEntry. This shouldn't require the JAR to be attached or in the app cache.

If loading classes from the JAR, there may be additional constraints, however. I think Chihiro or Bill might have commented on that in a past thread.

Joe

On Feb 25, 2010, at 12:57 PM, Joe Rice wrote:

> I wonder if you meed to add it to the BDJO application cache and attach it as a service domain using org.dvb.dsmcc.SeviceDomain#attach()? (See BD-ROM 3-2 11.5.1)
>
> Cheers,
> Joe
>
> On Feb 25, 2010, at 9:04 AM, bd-j-dev@mobileandembedded.org wrote:
>
>> Ok, I am still having errors reading from a jar different than the container of the main xlet in disk!
>> 1- Main class xxxx.Test.class
>> 2- bluray.Test.perm located in the xxxx folder contains:
>>
>>
>>
>>
>>
>> *
>>

>>
>>

>>
>> 3- The assets are located in a jar located in BDMV\JAR\00004.jar
>> 4- The 00004.jar fle has been signed using the net.java.bd.tools.security.BDSigner tool. This is the portion of the build.xml
>> ...
>>
>>
>>
>>

>> ...
>>
>> 5- In xxxx.Test.java code, I create an instance of DVBClassLoader
>> ...
>> DVBClassLoader cl = DVBClassLoader.newInstance(
>> new URL[]{new URL("bd://JAR:00004/")});
>>
>> 6- I check the permissions related with a file in that jar:
>> FilePermission f3= new FilePermission(
>> cl.getResource("diskFile.txt").toString()
>> , "read");
>> AccessController.checkPermission( f3); // OK
>>
>> 7- I print out the value of f3.getName() that is [file:C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt]
>>
>> 8- I try to read the file:
>> URL u = new URL(f3.getName());
>> BufferedReader fr = new BufferedReader(
>> new InputStreamReader(u.openStream()));
>> String line = fr.readLine();
>>
>> 9- This execution throws a java.security.AccessControlException (access denied (java.io.FilePermission C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt read))
>>
>> ?????- Could someone explain me why the AccessController in point 6 checks the file [file:C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt] and the AccessController in point 8 checks the file [C:/NotExistDir/Intervideo/JAR/0004//diskFile.txt]???
>>
>>
>>
>> Thanks,
>> [Message sent by forum member 'cgonzalez509' (cgonzalez@ita.es)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=388732
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
>> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

cgonzalez509
Offline
Joined: 2010-01-19
Points: 0

Hi Joe!

You are right, I got it using a JarFile reference.
At the end, the working code is as follows:
String jarFileName = (System.getProperty("bluray.vfs.root")
+ "/BDMV/JAR/00004.jar";
JarFile jf = new JarFile(jarFileName);

try {
ZipEntry ze = jf.getEntry(file2ReadFromDiscName);
BufferedReader fr = new BufferedReader(
new InputStreamReader(jf.getInputStream(ze)));
String line = fr.readLine();
....

terymas
Offline
Joined: 2007-09-03
Points: 0

Hi all, I fixe my issue : )

mihailm
Offline
Joined: 2008-01-24
Points: 0

Hi,

can you please tell us how you fixed it?

Thx

terymas
Offline
Joined: 2007-09-03
Points: 0

I have change my code, create prem file and my App is signed.
But nothing happen : (

If I draw my directorypath, I can see that : /VFS/BDMV/JAR/00000/

I don't find my issue.

Somebody have an idea

Thanks,
Tery

terymas
Offline
Joined: 2007-09-03
Points: 0

Hi all !

Thank you very guys...
I change my code and I create a PRF file.

I post a new message if I have some issues.

Tery

2themax
Offline
Joined: 2008-01-22
Points: 0

The code below will allow access to a specified folder on the disc. Is this case it's /BDMV/JAR/00000/.

private String rootDirectory = System.getProperty("bluray.vfs.root");
private String dirPath = rootDirectory+File.separator+"BDMV"+File.separator+"JAR"+File.separator+"00000"+File.separator;

In addition to that, you will also need a permissions file for the main xlet, the Jar file will need to be signed, and a corresponding app.discroot.crt will need to be created and placed in the CERTIFICATE folder.

dbreitenfeld
Offline
Joined: 2007-03-18
Points: 0

Hi,

You will need to create the Permissions Request File (PRF) where you xlet is located in its fully quilified path so if your xlet is in com.mycompany.bdj.MyXlet then your PRF will be placed in the same package and the name will have MyXlet in it like so: bluray.MyXlet.perm

Without going into all the details of the content inside the PRF here is an industry stanard one, expect for networking:






Your orgid and appid must be the same as your BDJO and or orgid in your certificate. The HD book source code talks about this so you should be able to get that information from there.
Good luck,

Denny B.
-------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio Blu-ray Team - DSA - http://dostudio.netblender.com [/i]

Joe Rice

I've been having a discussion with a security vendor around BD-J
security, and it would seem best practice would be to only request
permissions for things the Xlet actually uses, although certainly no
playback issues would be seen in cases where more permissions than
needed are specified.

Here's a super thumbnail version of the permissions requested by the
example PRF below as they pertain to BD:

>

Allows read/write access to the ADA (Application Data Area) in
persistent storage.

>

Allows use of the Application Listing and Launching APIs to start and
stop other Xlets.

>

Allows the application to make a new service selection. (eg, title
change)

>

Allows use of the User Settings and Preferences APIs

>

If set true, allows read/write access to the BUDA (Binding Unit Data
Area), although there are restrictions on what directories can be
accessed. When false, no access to the BUDA is granted.

>

If set true, allows use of the org.bluray.vfs APIs.

Cheers,
Joe

On Mar 21, 2008, at 7:02 AM, bd-j-dev@mobileandembedded.org wrote:

> Hi,
>
> You will need to create the Permissions Request File (PRF) where
> you xlet is located in its fully quilified path so if your xlet is
> in com.mycompany.bdj.MyXlet then your PRF will be placed in the same
> package and the name will have MyXlet in it like so:
> bluray.MyXlet.perm
>
> Without going into all the details of the content inside the PRF
> here is an industry stanard one, expect for networking:
>
>
> > >
>
>
>
>

>
> Your orgid and appid must be the same as your BDJO and or orgid in
> your certificate. The HD book source code talks about this so you
> should be able to get that information from there.
> Good luck,
>
>
> Denny B.
> -------------------------------------------------------------------------------------------------------------
> [i]NetBlender DoStudio Blu-ray Team - DSA - http://dostudio.netblender.com
> [/i]
> [Message sent by forum member 'dbreitenfeld' (dbreitenfeld)]
>
> http://forums.java.net/jive/thread.jspa?messageID=265182
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net