This is a static copy of a profile reportHome
iofun/private/urlreadwrite (4 calls, 0.000 sec)
Generated 05-Nov-2014 07:52:32 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/matlab/iofun/private/urlreadwrite.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
urlwrite | function | 4 |
Lines where the most time was spent
No measurable time spent in this functionLine Number | Code | Calls | Total Time | % Time | Time Plot |
55 | urlConnection = url.openConnec... | 4 | 0 s | 0% |  |
54 | if isempty(proxy) | 4 | 0 s | 0% |  |
50 | proxy = mwtcp.getProxy(); | 4 | 0 s | 0% |  |
49 | mwtcp = com.mathworks.net.tran... | 4 | 0 s | 0% |  |
40 | end | 4 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0 s | 0% | |
Children (called functions)
Code Analyzer results
Line number | Message |
14 | Use FIND with the 'first' or 'last' option. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 58 |
Non-code lines (comments, blank lines) | 20 |
Code lines (lines that can run) | 38 |
Code lines that did run | 17 |
Code lines that did not run | 21 |
Coverage (did run/can run) | 44.74 % |
Function listing
time calls line
1 function [urlConnection,errorid,errormsg] = urlreadwrite(fcn,urlChar)
2 %URLREADWRITE A helper function for URLREAD and URLWRITE.
3
4 % Matthew J. Simoneau, June 2005
5 % Copyright 1984-2009 The MathWorks, Inc.
6 % $Revision: 1.1.6.5 $ $Date: 2009/09/28 20:28:02 $
7
8 % Default output arguments.
4 9 urlConnection = [];
4 10 errorid = '';
4 11 errormsg = '';
12
13 % Determine the protocol (before the ":").
4 14 protocol = urlChar(1:min(find(urlChar==':'))-1);
15
16 % Try to use the native handler, not the ice.* classes.
4 17 switch protocol
4 18 case 'http'
4 19 try
4 20 handler = sun.net.www.protocol.http.Handler;
21 catch exception %#ok
22 handler = [];
23 end
24 case 'https'
25 try
26 handler = sun.net.www.protocol.https.Handler;
27 catch exception %#ok
28 handler = [];
29 end
30 otherwise
31 handler = [];
32 end
33
34 % Create the URL object.
4 35 try
4 36 if isempty(handler)
37 url = java.net.URL(urlChar);
4 38 else
4 39 url = java.net.URL([],urlChar,handler);
4 40 end
41 catch exception %#ok
42 errorid = ['MATLAB:' fcn ':InvalidUrl'];
43 errormsg = 'Either this URL could not be parsed or the protocol is not supported.';
44 return
45 end
46
47 % Get the proxy information using MathWorks facilities for unified proxy
48 % preference settings.
4 49 mwtcp = com.mathworks.net.transport.MWTransportClientPropertiesFactory.create();
4 50 proxy = mwtcp.getProxy();
51
52
53 % Open a connection to the URL.
4 54 if isempty(proxy)
4 55 urlConnection = url.openConnection;
56 else
57 urlConnection = url.openConnection(proxy);
58 end