Пример #1
0
        public Bundle(IBundleArchive ba)
        {
            this.id       = ba.Id;
            this.location = ba.Location;
            this.archive  = ba;
            this.theState = BundleState.Installed;

//            doExportImport();
//            FileTree dataRoot = fw.getDataStorage();
//            if (dataRoot != null)
//            {
//                bundleDir = new FileTree(dataRoot, Long.toString(id));
//            }
//            ProtectionDomain pd = null;
//            if (fw.bPermissions)
//            {
//                try
//                {
//                    URL bundleUrl = new URL(BundleURLStreamHandler.PROTOCOL, Long.toString(id), "");
//                    PermissionCollection pc = fw.permissions.getPermissionCollection(this);
//                    pd = new ProtectionDomain(new CodeSource(bundleUrl,
//                        (java.security.cert.Certificate[])null),
//                        pc);
//                }
//                catch (MalformedURLException never) { }
//            }
//            protectionDomain = pd;
//
//            int oldStartLevel = archive.getStartLevel();
//
//            try
//            {
//                if(framework.startLevelService == null)
//                {
//                    archive.setStartLevel(0);
//                }
//                else
//                {
//                    if(oldStartLevel == -1)
//                    {
//                        archive.setStartLevel(framework.startLevelService.getInitialBundleStartLevel());
//                    }
//                    else
//                    {
//                    }
//                }
//            }
//            catch (Exception e)
//            {
//                Debug.println("Failed to set start level on #" + getBundleId() + ": " + e);
//            }
        }
Пример #2
0
 public IBundleArchive ReplaceBundle(IBundleArchive old, System.IO.FileStream stream)
 {
     // TODO:  Add BundleStorage.ReplaceBundle implementation
     return(null);
 }