Lines Matching refs:filename

45             Pattern.compile("attachment;\\s*filename\\s*=\\s*\"([^\"]*)\"");
55 * This header provides a filename for content that is going to be
71 * Creates a filename (where the file should be saved) from info about a download.
121 // Split filename between base and extension
122 // Add an extension if filename does not have one
135 // Claim this filename inside lock to prevent other threads from
145 String filename = null;
148 if (filename == null && hint != null && !hint.endsWith("/")) {
150 Log.v(Constants.TAG, "getting filename from hint");
154 filename = hint.substring(index);
156 filename = hint;
161 if (filename == null && contentDisposition != null) {
162 filename = parseContentDisposition(contentDisposition);
163 if (filename != null) {
165 Log.v(Constants.TAG, "getting filename from content-disposition");
167 int index = filename.lastIndexOf('/') + 1;
169 filename = filename.substring(index);
175 if (filename == null && contentLocation != null) {
181 Log.v(Constants.TAG, "getting filename from content-location");
185 filename = decodedContentLocation.substring(index);
187 filename = decodedContentLocation;
193 if (filename == null) {
200 Log.v(Constants.TAG, "getting filename from uri");
202 filename = decodedUrl.substring(index);
207 // Finally, if couldn't get filename from URI, get a generic filename
208 if (filename == null) {
210 Log.v(Constants.TAG, "using default filename");
212 filename = Constants.DEFAULT_DL_FILENAME;
217 filename = replaceInvalidVfatCharacters(filename);
219 return filename;
261 String filename, int lastDotIndex) {
267 filename.substring(lastDotIndex + 1));
285 extension = filename.substring(lastDotIndex);
318 * As soon as a number is reached that generates a filename that doesn't exist,
319 * that filename is used.
320 * If the filename coming in is [base].[ext], the generated filenames are
334 throw new IOException("Failed to generate an available filename");
338 * Checks whether the filename looks legitimate for security purposes. This
670 * Replace invalid filename characters according to
674 private static String replaceInvalidVfatCharacters(String filename) {
692 for (int i = 0; i < filename.length(); i++) {
693 ch = filename.charAt(i);