How to determine the maximum allowable length of a filename for Window ?

Hi all,
Could I know how to determine the allowable file length (the length of the absolute path) for a file in Window environment?
Due to some reason, I generated a zip file with a very long filename ( > 170) and put in a folder(the length of the folder path around 90). The length of the absolute path is around 260.
I used FileOutputStream with the ZipOutputStream to write out the zip file. Everything is working fine while i generating the zip file.
However, while i try to extract some files from the zip file i just created, i encountered the error
java.util.zip.ZipException The filename is too long.
I am using the class ZipFile to extract the files from the zip file like the following
String absPath = "A very long filepath which exceed 260";
ZipFile zipF = new ZipFile(absPath);  //<-- here is the root causeIs it possible to pre-determine the maximum allowable filepath length prior i generate the zip file ? This is weird since i got no error while i created the zip file, but have problem in extracting the zip file ......
Thanks

Assuming you could determine the max, what would you do about it? I'd say you should just assume it will be successful, but accommodate (handle) the possible exception gracefully. Either way you're going to have to handle it as an "exception", whether you "catch" an actual "Exception" object and deal with that, or manually deal with the length exceeding the max.

Similar Messages

  • How to determine the maximum prefix of two CharSequences efficiently?

    I have the following problem. I need a unicode friendly mechanism for determining the maximum prefix of 2 CharacterSequences. I've come up with the following code which appears to do the job, but which requires up to ([number of codepoints in smaller sequence] * 2) + 1 memory allocations. These memory allocations are rather irksome since I plan on calling this method extremely many times. The code I came up with looks like:
    private static int getLengthOfMaxCommonPrefix(CharSequence str1, CharSequence str2, Collator collator) {
        if ((str1 == null) || (str2 == null)) { return 0; }
        if (Character.codePointCount(str1, 0, str1.length()) > Character.codePointCount(str2, 0, str2.length())) {
          CharSequence tmp = str1;
          str1 = str2;
          str2 = tmp;
        // @todo get rid of memory allocation
        char[] charArray = new char[4];
        int i = 0;
        for (int size = Character.codePointCount(str1, 0, str1.length()); i < size; i++) {
          Character.toChars(Character.codePointAt(str1, i), charArray, 0);
          Character.toChars(Character.codePointAt(str2, i), charArray, 2);
           // @todo get rid of memory allocation
          String char1Str = new String(charArray, 0, 2);
          // @todo get rid of memory allocation
          String char2Str = new String(charArray, 2, 2);
          if (collator.compare(char1Str, char2Str) != 0) {
            return i;
        return i;
      }Am I overlooking an API that would allow me have this same functionality without memory allocations? If not, would it be reasonable to request that the Java Collator API be updated to have:
    Collator.compare(int codepoint1, int codepoint2)which would eliminate the need for these memory allocations. The only reason I would suggest this change is that more than a few pieces of my other code involving unicode has the same problem. Also, when looking over the API it seems that
    static Character.toString(char c)exists, but the following method doesn't:
    static Character.toString(int codepoint)which would at least minimize some of the ugliness in the above code and be in keeping with the other APIs under Character.
    Edited by: APBrusseau on Feb 10, 2008 11:23 PM
    Edited by: APBrusseau on Feb 10, 2008 11:24 PM
    Edited by: APBrusseau on Feb 10, 2008 11:29 PM
    Edited by: APBrusseau on Feb 10, 2008 11:45 PM
    Edited by: APBrusseau on Feb 10, 2008 11:46 PM
    Edited by: APBrusseau on Feb 10, 2008 11:48 PM

    But still, surely just walking character by character through the strings and comparing them (using your collator) will do?
        char[] c1 = new char[1];
        char[] c2 = new char[1];
        // swap longest/shortest string, etc.
        // for each char {
            c1[0] = cs1.charAt(n);
            c2[0] = cs2.charAt(n);
            s1 = new String(c1);
            s2 = new String(c2);
            // use collator to compare
        // }The only thing I don't know is whether there are collators which look at sequences of characters. For example, I think in Unicode, you can have an 'a' followed by a 'add an accent to the previous character' character, which would obviously impact on the collation order.
    In which case, something like
        // for n = 1 .. length of shortest {
            int result = collator.compare(cs1.subSequence(0, n).toString(), cs2.subSequence(0, n).toString());
            if (result != 0) {
                return result;
        // equal to length of shortest string. Make decision based on length.This might be efficient, or not, depending on the implementation of CharSequence. String, for example, has a very efficient subSequence() method.

  • How to determine the maximum size of JFrame?

    I am using JDK1.2 to develop an application. I have
    a problem to handle the maximum size of of JFrame.
    If the user clicks the maximum icon or double-clicks
    the title bar from the JFrame, the JFrame becomes
    maximum. How can I determine the state of maximization? I need to bring different views if the
    JFrame is maximum or minimum. I knew JDK1.4 can
    handle this problem. Or using JNI, either. Does
    anyone know other ways to handle this?
    Thanks,
    Peter

    So that you won't have to wait forever:
    Sorry, pal, the only way is JNI. I researched this earlier for 1.2, but can't find it right now in the database. They finally added it to 1.4.
    Good luck.

  • How can install the Fractal Image plug-in into Firefox for Windows 7?

    I have the plug-in necessary to view fractal images built with the now no longer Iterated Systems program "Fractal Imager." These are files with the .fif extension and the plug-in is needed to view them. The plug in I have is fully functional. The problem I am having is that I needed instructions on how to upload this plug-in into Firefox for Windows.

    There has been a change in where Firefox searches for plugins and the plugins folder in the Firefox program folder is no longer scanned for plugins, so Firefox won't find them anymore if they are installed in the plugins folder instead of the "browser\plugins" folder that Firefox now scans.
    You can set the plugins.load_appdir_plugins pref to true on the about:config page to make Firefox scan the "<install>/plugins/" directory for plugins like the WMP plugin (np-mswmp.dll).
    You can alternatively move plugins from "<install directory>\plugins\" to "<install directory>\browser\plugins\" (create this folder when missing) to make Firefox find them again.
    *http://www.ghacks.net/2013/05/15/why-you-may-have-lost-access-to-plugins-or-extensions-in-firefox-21/
    *http://mike.kaply.com/2013/04/24/major-changes-coming-in-firefox-21/
    *https://support.mozilla.org/kb/windows-media-or-other-plugins-stopped-working

  • How to determine the maximum temperature in a consecutive of 2 minutes?

    I am doing the following application:
    1) Temperature signal is read in every 1 second, define in a while loop;
    2) I want to make sure that in a consecutive of 2 minutes, temperature value is always lower than a value, say 10 degree C;
    3) If it can meet the criterion, returns true, otherwise continue monitoring until it is true.
    A possible way it to define an 1D array with 120 elements, but I would like to know if there is a more elegant way? I cannot put the array in a subVI, as it is destroyed once subVI is left. LabVIEW system provides "RMS" calculation function (everything is in a sub VI) and I do not the function used in that VI.
    Solved!
    Go to Solution.

    Ah!! so thats what you meant, ok.
    You can easily implement this as a subvi:
    This is what the subvi would look like. You would use a while loop that only iterates once with an un-initialised shift register. This will then store the last value in its shift register.
    This is how it would look on your main vi:
    In this version you do not need to wire the time limit, its default value is 120. If you ever want to change this though you can wire in a new value.
    Rgs,
    Lucither
    Message Edited by Lucither on 05-06-2010 05:04 AM
    "Everything should be made as simple as possible but no simpler"
    Attachments:
    get if temp steady for 2 mins.vi ‏26 KB
    Temp comparison and increment demo.vi ‏9 KB

  • I'll like to know how to promote the 5 games i have in mind for Windows Phone

    Hi everyone,
    i love coding and would like to know how games are discovered on windows phone..
    i am about to build five games and would love to know how to promote them..so they can be downloaded..
    thanks
    seun

    Hi Seun,
    Please refer to the following links to get started.
    http://channel9.msdn.com/events/BUILD/BUILD2011/APP-791T.
    http://msdn.microsoft.com/en-us/library/windows/apps/hh452744.aspx.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • I need more than the maximum allowed 30 profiles - how do I change this?

    I need more than the maximum allowed 30 profiles - how do I change this? Once I reach 30 profiles and I try to add one - it just deletes one automatically thus only allowing a maximum of 30. Please help.

    You are talking about 30 Firefox Profiles on the same Windows Logon User Account?
    I never saw that as a limit myself. I had 53 Profiles at one time, although I haven't done that since Firefox 3.0. It was causing an extended launch time and I started using "remote" Profiles that weren't controlled by the Profile Manager and weren't in the '''profiles.ini''' file; launched by command line. Like this in the Target line for the desktop shortcut: <br />
    ''' "C:\Program Files\Firefox_4.0_zip\firefox.exe" -Profile D:\Mozilla\Active-Profiles\4.0_10-15-10-N '''

  • How to determine the length of a curved path in illustrator CS2

    how to determine the length of a curved path in illustrator CS2?

    bornfree,
    The free Patharea/Pathlength Filters from Telegraphics is your friend (the former gives you both area and length, both in different units):
    Telegraphics - Free plugins for Photoshop & Illustrator...and other software

  • Mail responds with this error when I have attachments which are not that large.  How can I get around this. very aggravating. error reads Your message has size 32.1 MB, which exceeds 28.3 MB, the maximum allowed by the server.

    error message is-Your message has size 32.1 MB, which exceeds 28.3 MB, the maximum allowed by the server.  What can I do to get it to accept larger files. This was only 4 pages scanned.

    You can use the Preview app to reduce the fille size or send multiple emails.

  • Upgrade error  "exceeded maximum allowed length (134217728 bytes)

    Hi:
    I'm trying to add a patch to the OEM patch cache, and I'm getting an error:
    Error: - Failed to Upload File.Uploaded file of length 545451768 bytes exceeded maximum allowed length (134217728 bytes)
    The patch file is what it is (545451768 bytes). How do I install this patch? I'm trying to upgrade a 10.1.0.3 DB to 10.1.0.4
    Thanks

    This log is for external user.
    Did you deploy Lync edge server?
    The Edge Server rejects the authentication request, and redirects the Lync 2010 client to the Lync Web Services (https://lyncexternal.contoso.com/CertProv/CertProvisioningService.svc).
    It seems the redirect fails, please check the event view on Lync edge Server.  
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • How to determine the ROWNUM in a Master Detail Form

    Hello,
    I am working in a Master Detail Form with Orders and Order Items Information; and I created a process that allows the users to select a Product ID on a tabular form, and the next column is populated automatically with the Product Description.
    To achieve that, I followed some instructions by Denes Kubicek (http://apex.oracle.com/pls/otn/f?p=31517:241), but my case is slightly different:
    <ul>I am using a wizard-created tabular form, instead of a manual tabular form; and </ul>
    <ul>Instead of using another page as a Popup to pass the parameter of the ROWNUM, I am using a plug-in called “Tabular Form Super LOV” which is a modified version of the SkillBuilders’ Super LOV that works on Tabular Forms. </ul>
    The Product ID is returned in the correct row by the plug-in; but in the case of the Product Description, it is always returned into the first row; and my problem is that I don't know how to determine the row where the user clicked to call the plug-in.
    I set up an example in apex.oracle.com in case someone would like to look at it:
    Workspace: ediazjorge
    Username: test
    Password: test
    App Name: Sample App
    App Number: 1550
    BTW, I am using Apex 4.1.1.00.23 and Oracle DB 10.3.2.
    Thanks in advance,
    Erick

    Hello VC,
    Thank you for your time and help.
    Unfortunately, it is still not working properly:
    1. When the Popup LOV opens, the first row of the tabular form is 0, the second row is 1, and so on. How can I assign the values starting with 1 and in the format *0001* ? (I am still a novice on Apex and new to JavaScript :-), sorry about that).
    --2. Also, when I close the Popup LOV, the value of P1_ROWNUM is ‘undefined’ again so I'm not sure if the Product Name column will be populated.--
    3. And finally, you are using the jQuery Selector uPopupLOVIcon, which is an attribute of the Cloudy Theme. In my real application (Apex 4.1.1.00.26), my element looks like: *<img src="/i/lov_16x16.gif" width="16" height="16" alt="Popup Lov" alt="List" style="vertical-align:middle;" align="middle" />*. What do you recommend me to use as a jQuery Selector?
    Again, I really appreciate your help and time. I think you solved the most difficult part.
    Thank you so much,
    Erick
    Update: I just found out that the problem with my comment 2 is because I didn’t delete the previous dynamic action that set the value to P1_ROWNUM.
    Edited by: ediazjorge on Sep 18, 2012 11:20 AM

  • How to determine the support team in service ticket

    Hi all,
    can u guide me how to determine the support team in service ticket,
    when ticket is created from customer system.is there any another way other than organizational structurel settings.
    Thanks and regards,

    Hi Venu,
    You can get it done by development to determnie the support team , other tan org model settings
    1.Develop the z table which will allow to maintain Sold to Party, Component, Support team
    2. Implement the Badi for which will read the sold to party and component from the ticket and look in to ztable and fetch the corresponding support team and audate the support team feald in ticket.For this to take help of ur Abaper
    3. For this to call the BADI have to confgure the actions with method call.
    If u have any query revert
    Regards,
    Basha.

  • How can determine the duration of an audio file

    Hi,
    i'm making speech recognition project using java. i can capture sound by michrophone and playback it. the type of the sound is .wav.
    my question is how to determine the recording duration (for example: determine the duration for 0.25 second) because i must recorded syllable,the assumtion is needed less than 0.5 second to say a word. and then.. can this wav file be changed into... binary or integer ?
    thanks for your help

    FYI I'm newbie in Java,
    Yes, I want to limit the audio file lengths to a certain value. What should I do?
    I have read wav file using an AudioInputStream, for audio format I'm using sampleRate = 8000.0F and sampleSizeInBits = 8. My friend said if I used 8 bit for sampleSizeInBit (resolution in amplitude) the binary file should be -128 till 127 in range according to the bit. I try this code and the result is binary file which is zero, positive, and negative.
    the code
    try{
    audioInputStream.read(audioBytes);
    for (int i=0; i<audioBytes.length;i++){
    System.out.println(audioBytes);
    catch(IOException ioe){
    System.out.println("Error"+ioe);
    I'm not sure that the code is right, but it works. Should I change the audioBytes into integer before? I try this code but it doesn't work.
    int a = new int[audioBytes.length];
    for (int i=0;i<audioBytes.length;i++){
    a[i] = new Byte(audioBytes[i]).intValue();
    this binary file has been printed in console (I’m using texpad). So, how I can write that to file.txt? I'm using FileoutputStream but it doesn't work correctly. Here is the code
    FileOutputStream fos = new FileOutputStream(strFilePath);
    {audioInputStream.read(audioBytes);
    fos.write(audioBytes);
    catch (IOException ioe){
    System.out.println("Error"+ioe);
    When I open file .txt is read as character like this üüüüüüüüüüüüûüüüûüûûû ||||||| ||||||| ||||||||||||||||||||||||||||| &#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746;&#1746; (like using alt plus number)
    Edited by: anasfr on Mar 19, 2009 9:02 AM

  • Insufficient rights - How to determine the correct rights?

    All,
    Does anyone know how to determine the correct rights if you get the error message "Insufficient rights for operation"?
    In SAP backend systems you can start transaction SU53 to check your "missing" authorizations, but is something like that also possible in MDM?
    I also don't see any detailed information in the logs or reports.
    If anyone has an good suggestion, please let me know, since I don't want to do "trail and error" to know what Functions to set to Execute and what Tables/Fields to set to Read/Write (because there are quite some combinations to check).
    p.s. I've read the complete reference guide of the MDM console and sometimes it's really obvious what Functions and Tables/Fields you have to set, but for instance when I want to give authorization to maintain Relationships in the DataManager and have set the Main table and all Relationships to Read/Write and have set all Records and DataManager functions to Execute it still doesn't allow me to maintain the relationships on the records! I only get the message "insufficient rights" and it's unclear what rights are missing!
    Regards,
    Marcel

    hi Marcel,
    I doubt if we have anything in MDM to show you what authorizations are missing.However,you can check the following :
    1. What activity are you trying to perform when you get this error.
    2. Check if authorization are given in the role for that actitvity.
    3. Check how many roles are allocated to user and  Is authorization given in all roles if more than 1 role is assigned to that user?
    Please let us know answer of the queries...
    Regards,
    Vineet

  • How to find the maximum no of users logged in Database

    Hi All,
    How to find the maximum number of users logged in database at particular time? I can find currently logged users or umber of sessions running on Database but I wanted to find at what time maximum number of users or sessions connected to the DB? is that possible? if yes please help me. thanks.

    Vijay wrote:
    Hi All,
    How to find the maximum number of users logged in database at particular time? I can find currently logged users or umber of sessions running on Database but I wanted to find at what time maximum number of users or sessions connected to the DB? is that possible? if yes please help me. thanks.
    select * from v$resource_limit;Lists about 20 different resources with current, maximum and limit on usage. Session count is one of them. I don't think there's any (simple, efficient) way to determine the maximum number of different users of sessions, though.
    Regards
    Jonathan Lewis

Maybe you are looking for

  • Interfacing between SAP ECC 6.0 and Lotus Notes

    Hello Guru's, I have a requirement where I need to catch billing document number from Lotus notes interface and send related information back to it. Agreed approach to hadle this is using webservices. Could you please guide me initial steps how to do

  • How to start from scratch?

    My G40 2388 is running slow although I have increased the memory. I spoke to a computer sales person who did not try to sell me a new laptop but said that it could help to make backup of all documents etc and then reinstall everything and start from

  • How do you burn project as Disk Utility?

    I have been getting an error message #6 (0x29,0x00) on every project I try to burn to my external LaCie burner. I have burned several projects on it before. I have been doing all the things that the pros on this site say to do,delete idvdplist, clear

  • Where is the Inspector Window for Text Edit for Office Org.

    Where is the Inspector Window for Text Edit for Office Org.  My tool bar does not look like this.  It's only one line with font, Style, size, font color,  BIU, alignment, line spaces and indentation options.  The help says that this is how I adjust m

  • Backup Mac to Windows shared NTFS drive.

    Hey. I'd like to backup my Mac's data (running Mavericks) with Time Machine to a Windows shared NTFS drive on my network. I'm fairly sure this is possible with some type of network drive. Anyone know how to make this work?