Changeset 194 in tmcsimulator-scriptbuilder for trunk/src


Ignore:
Timestamp:
01/20/2020 07:37:05 PM (6 years ago)
Author:
sdanthin
Message:

SimulationScript?.java added System paths in place of "/" for cross platform compatability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/SimulationScript.java

    r182 r194  
    274274     */ 
    275275    private void createAudioDirectory(Path path){ 
    276         File f = new File(path.toString()+"/audio"); 
     276        String separator = System.getProperty("file.separator"); 
     277        File f = new File(path.toString()+separator+"audio"); 
    277278        if(!f.exists()) 
    278279        { 
     
    285286            { 
    286287                String name = ((Integer) i.number).toString(); 
    287                 File incidentFolder = new File(path.toString()+"/audio/"+name); 
     288                File incidentFolder = new File(path.toString()+separator+"audio"+separator+name); 
    288289                if(!incidentFolder.exists()) 
    289290                { 
     
    306307                            String output = radioEvent.toScriptFile(); 
    307308                            //optimally, this line should use the ID, but to account for files being read in, it needs to be the radiofile name 
    308                             File newAudioScript = new File(path.toString()+"/audio/"+name+"/"+radioEvent.radioFile.replaceAll(".mp3","")+".txt"); 
     309                            File newAudioScript = new File( 
     310                                    path.toString()+ 
     311                                            separator+ 
     312                                            "Audio"+ 
     313                                            separator+ 
     314                                            name+ 
     315                                            separator+ 
     316                                            radioEvent.radioFile.replaceAll(".mp3","")+ 
     317                                            ".txt"); 
    309318                             
    310319                            try 
     
    317326                            }catch(Exception e) 
    318327                            { 
    319                                 System.err.println("there was a problem creating your text files"); 
     328                                //to find the bug that triggers this Exception, we need to print out the lines that  
     329                                System.err.println("there was a problem creating your text files for: " + radioEvent.radioFile + "\n" + e.getMessage()); 
    320330                            } 
    321331 
Note: See TracChangeset for help on using the changeset viewer.