Changeset 1838

Show
Ignore:
Timestamp:
01/17/08 13:11:39 (1 year ago)
Author:
gboyst
Message:

eclipse bloes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/transwork/framework-plugin/src/com/tresys/framework/compiler/Compiler.java

    r1470 r1838  
    1212package com.tresys.framework.compiler; 
    1313 
     14import java.io.ByteArrayOutputStream; 
    1415import java.io.FileOutputStream; 
    1516import java.io.FileNotFoundException; 
     
    2425import com.tresys.framework.compiler.policy.Policy; 
    2526import com.tresys.framework.compiler.systemResources.SystemResources; 
    26 import com.tresys.framework.compiler.translator.Translator
     27import com.tresys.framework.compiler.translator.TranslatorSELinux
    2728 
    2829/** 
     
    247248                Linkage linkage = null; 
    248249                // the translator 
    249                 Translator translator = null; 
     250                TranslatorSELinux translator = null; 
    250251 
    251252                dictSourceFilenames = new Vector/*<String>*/(); 
     
    357358                        fcFile = new File(fcFilename); 
    358359 
    359                 translator = new Translator(policy, linkage, fcFile); 
    360  
     360                translator = new TranslatorSELinux(policy, linkage, fcFile.getName()); 
     361                policy.Accept(translator); 
     362                 
     363                final ByteArrayOutputStream teData = translator.GetPolicy(); 
     364                final ByteArrayOutputStream ifData = translator.GetInterfaces(); 
     365                final ByteArrayOutputStream fcData = translator.GetSytemResources (); 
     366                 
    361367                if(polOutputFilename != null) { 
    362368                        try { 
     
    382388                        moduleName = moduleName.substring(slash + 1); 
    383389 
    384                 translator.TranslatePolicy(streamPolicy, moduleName); 
     390                streamPolicy.append(teData.toString ()); 
    385391 
    386392                if(ifFilename != null) { 
     
    397403                        streamInterface = System.out; 
    398404                } 
    399                 translator.TranslateInterface(streamInterface); 
     405                streamPolicy.append (ifData.toString ()); 
    400406 
    401407                if(fcOutputFilename != null) { 
     
    412418                        streamFileContext = System.out; 
    413419                } 
    414  
    415                 translator.TranslateSystemResources(streamFileContext, streamPolicy); 
    416  
     420                streamFileContext.append(fcData.toString ()); 
     421                 
    417422                streamPolicy.flush(); 
    418423                streamPolicy.close(); 
     
    425430 
    426431                // test for error conditions 
    427                 if(translator.ErrorEncountered) { 
     432                if(translator.GetErrorState()) { 
    428433                        System.err.println("Errors encountered during translation!"); 
    429434                        if(polOutputFilename != null) { 
  • branches/transwork/framework-plugin/src/com/tresys/framework/compiler/translator/TranslatorSELinux.java

    r1837 r1838  
    105105        private TreeSet/*<String>*/dirPermSet = new TreeSet/*<String>*/(); 
    106106         
    107         public TranslatorSELinux(Linkage _linkage, String _moduleName, Policy _policy)  
     107        public TranslatorSELinux(Policy _policy, Linkage _linkage, String _moduleName)  
    108108        { 
    109109                super(); 
     
    642642                                        if(fileType == null)  
    643643                                        { 
    644                                                 if(hasFileContext)  
     644                                                if(!hasFileContext)  
    645645                                                { 
    646                                                         Utility.ProjectError("Unable to determine file context for " 
     646                                                        Utility.ProjectError("ASDFASDFASDF#### Unable to determine file context for " 
    647647                                                                + file.toString() + ", try associating the parent directory with a CDSFramework component"); 
    648648                                                        errorEncountered = true; 
  • branches/transwork/framework-plugin/src/com/tresys/framework/plugin/builder/SELinuxSystem.java

    r1837 r1838  
    512512 
    513513                        // only pass in file contexts if we were able to load libselinux 
    514                         final TranslatorSELinux translatorSELinux = new TranslatorSELinux(getLinkage(), m_name, m_policy);  
     514                        final TranslatorSELinux translatorSELinux = new TranslatorSELinux(m_policy, getLinkage(), m_name);  
    515515 
    516516                        m_policy.Accept(translatorSELinux);